Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DomCrawler] Revert previous restriction, allow selection of every DOMNode object #17035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[DomCrawler] Updated exception messages.
  • Loading branch information
EdgarPE committed Dec 22, 2015
commit 58de1fa8f3c839f7f2c83ddc7cbe552a384d4455
8 changes: 4 additions & 4 deletions 8 src/Symfony/Component/DomCrawler/Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ public function selectButton($value)
*
* @return Link A Link instance
*
* @throws \InvalidArgumentException If the current node list is empty or contains non-DOMElement instances
* @throws \InvalidArgumentException If the current node list is empty or the selected node is not instance of DOMElement
*/
public function link($method = 'get')
{
Expand All @@ -706,7 +706,7 @@ public function link($method = 'get')
$node = $this->getNode(0);

if (!$node instanceof \DOMElement) {
throw new \InvalidArgumentException(sprintf('The current node list should contain only DOMElement instances, "%s" found.', get_class($node)));
throw new \InvalidArgumentException(sprintf('The selected node should be instance of DOMElement, got "%s".', get_class($node)));
}

return new Link($node, $this->baseHref, $method);
Expand Down Expand Up @@ -741,7 +741,7 @@ public function links()
*
* @return Form A Form instance
*
* @throws \InvalidArgumentException If the current node list is empty or contains non-DOMElement instances
* @throws \InvalidArgumentException If the current node list is empty or the selected node is not instance of DOMElement
*/
public function form(array $values = null, $method = null)
{
Expand All @@ -752,7 +752,7 @@ public function form(array $values = null, $method = null)
$node = $this->getNode(0);

if (!$node instanceof \DOMElement) {
throw new \InvalidArgumentException(sprintf('The current node list should contain only DOMElement instances, "%s" found.', get_class($node)));
throw new \InvalidArgumentException(sprintf('The selected node should be instance of DOMElement, got "%s".', get_class($node)));
}

$form = new Form($node, $this->uri, $method, $this->baseHref);
Expand Down
6 changes: 3 additions & 3 deletions 6 src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ public function testLink()

/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage The current node list should contain only DOMElement instances
* @expectedExceptionMessage The selected node should be instance of DOMElement
*/
public function testInvalidLink()
{
Expand All @@ -747,7 +747,7 @@ public function testInvalidLink()

/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage The current node list should contain only DOMElement instances
* @expectedExceptionMessage The selected node should be instance of DOMElement
*/
public function testInvalidLinks()
{
Expand Down Expand Up @@ -829,7 +829,7 @@ public function testForm()

/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage The current node list should contain only DOMElement instances
* @expectedExceptionMessage The selected node should be instance of DOMElement
*/
public function testInvalidForm()
{
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.