You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #39691 [DomCrawler] fix tests to run assertions on returned Crawler instances (xabbuh)
This PR was merged into the 4.4 branch.
Discussion
----------
[DomCrawler] fix tests to run assertions on returned Crawler instances
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
1d0c916 fix tests to run assertions on returned Crawler instances
$this->assertNotSame($crawler, $crawler->eq(0), '->eq() returns a new instance of a crawler');
250
-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->eq() returns a new instance of a crawler');
250
+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->eq(0), '->eq() returns a new instance of a crawler');
251
251
252
252
$this->assertEquals('Two', $crawler->eq(1)->text(), '->eq() returns the nth node of the list');
253
253
$this->assertCount(0, $crawler->eq(100), '->eq() returns an empty crawler if the nth node does not exist');
@@ -412,7 +412,7 @@ public function testFilterXPath()
412
412
{
413
413
$crawler = $this->createTestCrawler();
414
414
$this->assertNotSame($crawler, $crawler->filterXPath('//li'), '->filterXPath() returns a new instance of a crawler');
415
-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->filterXPath() returns a new instance of a crawler');
415
+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->filterXPath('//li'), '->filterXPath() returns a new instance of a crawler');
@@ -632,7 +632,7 @@ public function testSelectLink()
632
632
{
633
633
$crawler = $this->createTestCrawler();
634
634
$this->assertNotSame($crawler, $crawler->selectLink('Foo'), '->selectLink() returns a new instance of a crawler');
635
-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->selectLink() returns a new instance of a crawler');
635
+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->selectLink('Foo'), '->selectLink() returns a new instance of a crawler');
636
636
637
637
$this->assertCount(1, $crawler->selectLink('Fabien\'s Foo'), '->selectLink() selects links by the node values');
638
638
$this->assertCount(1, $crawler->selectLink('Fabien\'s Bar'), '->selectLink() selects links by the alt attribute of a clickable image');
@@ -651,7 +651,7 @@ public function testSelectImage()
651
651
{
652
652
$crawler = $this->createTestCrawler();
653
653
$this->assertNotSame($crawler, $crawler->selectImage('Bar'), '->selectImage() returns a new instance of a crawler');
654
-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->selectImage() returns a new instance of a crawler');
654
+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->selectImage('Bar'), '->selectImage() returns a new instance of a crawler');
655
655
656
656
$this->assertCount(1, $crawler->selectImage('Fabien\'s Bar'), '->selectImage() selects images by alt attribute');
657
657
$this->assertCount(2, $crawler->selectImage('Fabien"s Bar'), '->selectImage() selects images by alt attribute');
@@ -662,7 +662,7 @@ public function testSelectButton()
662
662
{
663
663
$crawler = $this->createTestCrawler();
664
664
$this->assertNotSame($crawler, $crawler->selectButton('FooValue'), '->selectButton() returns a new instance of a crawler');
665
-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->selectButton() returns a new instance of a crawler');
665
+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->selectButton('FooValue'), '->selectButton() returns a new instance of a crawler');
0 commit comments