Skip to content

Commit 2072afb

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: Cleanup CI scripts fix code style fix code style take query and request parameters into account when matching routes mistake fix tests to run assertions on returned Crawler instances
2 parents 545f073 + 5d7a9ad commit 2072afb

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

Tests/AbstractCrawlerTest.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public function testEq()
247247
{
248248
$crawler = $this->createTestCrawler()->filterXPath('//li');
249249
$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');
251251

252252
$this->assertEquals('Two', $crawler->eq(1)->text(), '->eq() returns the nth node of the list');
253253
$this->assertCount(0, $crawler->eq(100), '->eq() returns an empty crawler if the nth node does not exist');
@@ -403,7 +403,7 @@ public function testFilterXPath()
403403
{
404404
$crawler = $this->createTestCrawler();
405405
$this->assertNotSame($crawler, $crawler->filterXPath('//li'), '->filterXPath() returns a new instance of a crawler');
406-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->filterXPath() returns a new instance of a crawler');
406+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->filterXPath('//li'), '->filterXPath() returns a new instance of a crawler');
407407

408408
$crawler = $this->createTestCrawler()->filterXPath('//ul');
409409
$this->assertCount(6, $crawler->filterXPath('//li'), '->filterXPath() filters the node list with the XPath expression');
@@ -570,7 +570,7 @@ public function testFilter()
570570
{
571571
$crawler = $this->createTestCrawler();
572572
$this->assertNotSame($crawler, $crawler->filter('li'), '->filter() returns a new instance of a crawler');
573-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->filter() returns a new instance of a crawler');
573+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->filter('li'), '->filter() returns a new instance of a crawler');
574574

575575
$crawler = $this->createTestCrawler()->filter('ul');
576576

@@ -623,7 +623,7 @@ public function testSelectLink()
623623
{
624624
$crawler = $this->createTestCrawler();
625625
$this->assertNotSame($crawler, $crawler->selectLink('Foo'), '->selectLink() returns a new instance of a crawler');
626-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->selectLink() returns a new instance of a crawler');
626+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->selectLink('Foo'), '->selectLink() returns a new instance of a crawler');
627627

628628
$this->assertCount(1, $crawler->selectLink('Fabien\'s Foo'), '->selectLink() selects links by the node values');
629629
$this->assertCount(1, $crawler->selectLink('Fabien\'s Bar'), '->selectLink() selects links by the alt attribute of a clickable image');
@@ -642,7 +642,7 @@ public function testSelectImage()
642642
{
643643
$crawler = $this->createTestCrawler();
644644
$this->assertNotSame($crawler, $crawler->selectImage('Bar'), '->selectImage() returns a new instance of a crawler');
645-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->selectImage() returns a new instance of a crawler');
645+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->selectImage('Bar'), '->selectImage() returns a new instance of a crawler');
646646

647647
$this->assertCount(1, $crawler->selectImage('Fabien\'s Bar'), '->selectImage() selects images by alt attribute');
648648
$this->assertCount(2, $crawler->selectImage('Fabien"s Bar'), '->selectImage() selects images by alt attribute');
@@ -653,7 +653,7 @@ public function testSelectButton()
653653
{
654654
$crawler = $this->createTestCrawler();
655655
$this->assertNotSame($crawler, $crawler->selectButton('FooValue'), '->selectButton() returns a new instance of a crawler');
656-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->selectButton() returns a new instance of a crawler');
656+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->selectButton('FooValue'), '->selectButton() returns a new instance of a crawler');
657657

658658
$this->assertEquals(1, $crawler->selectButton('FooValue')->count(), '->selectButton() selects buttons');
659659
$this->assertEquals(1, $crawler->selectButton('FooName')->count(), '->selectButton() selects buttons');
@@ -798,7 +798,7 @@ public function testLinks()
798798

799799
$this->assertCount(4, $crawler->links(), '->links() returns an array');
800800
$links = $crawler->links();
801-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Link', $links[0], '->links() returns an array of Link instances');
801+
$this->assertContainsOnlyInstancesOf('Symfony\\Component\\DomCrawler\\Link', $links, '->links() returns an array of Link instances');
802802

803803
$this->assertEquals([], $this->createTestCrawler()->filterXPath('//ol')->links(), '->links() returns an empty array if the node selection is empty');
804804
}
@@ -810,7 +810,7 @@ public function testImages()
810810

811811
$this->assertCount(4, $crawler->images(), '->images() returns an array');
812812
$images = $crawler->images();
813-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Image', $images[0], '->images() returns an array of Image instances');
813+
$this->assertContainsOnlyInstancesOf('Symfony\\Component\\DomCrawler\\Image', $images, '->images() returns an array of Image instances');
814814

815815
$this->assertEquals([], $this->createTestCrawler()->filterXPath('//ol')->links(), '->links() returns an empty array if the node selection is empty');
816816
}
@@ -849,7 +849,7 @@ public function testLast()
849849
{
850850
$crawler = $this->createTestCrawler()->filterXPath('//ul[1]/li');
851851
$this->assertNotSame($crawler, $crawler->last(), '->last() returns a new instance of a crawler');
852-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->last() returns a new instance of a crawler');
852+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->last(), '->last() returns a new instance of a crawler');
853853

854854
$this->assertEquals('Three', $crawler->last()->text());
855855
}
@@ -858,7 +858,7 @@ public function testFirst()
858858
{
859859
$crawler = $this->createTestCrawler()->filterXPath('//li');
860860
$this->assertNotSame($crawler, $crawler->first(), '->first() returns a new instance of a crawler');
861-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->first() returns a new instance of a crawler');
861+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->first(), '->first() returns a new instance of a crawler');
862862

863863
$this->assertEquals('One', $crawler->first()->text());
864864
}
@@ -867,7 +867,7 @@ public function testSiblings()
867867
{
868868
$crawler = $this->createTestCrawler()->filterXPath('//li')->eq(1);
869869
$this->assertNotSame($crawler, $crawler->siblings(), '->siblings() returns a new instance of a crawler');
870-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->siblings() returns a new instance of a crawler');
870+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->siblings(), '->siblings() returns a new instance of a crawler');
871871

872872
$nodes = $crawler->siblings();
873873
$this->assertEquals(2, $nodes->count());
@@ -990,7 +990,7 @@ public function testNextAll()
990990
{
991991
$crawler = $this->createTestCrawler()->filterXPath('//li')->eq(1);
992992
$this->assertNotSame($crawler, $crawler->nextAll(), '->nextAll() returns a new instance of a crawler');
993-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->nextAll() returns a new instance of a crawler');
993+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->nextAll(), '->nextAll() returns a new instance of a crawler');
994994

995995
$nodes = $crawler->nextAll();
996996
$this->assertEquals(1, $nodes->count());
@@ -1008,7 +1008,7 @@ public function testPreviousAll()
10081008
{
10091009
$crawler = $this->createTestCrawler()->filterXPath('//li')->eq(2);
10101010
$this->assertNotSame($crawler, $crawler->previousAll(), '->previousAll() returns a new instance of a crawler');
1011-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->previousAll() returns a new instance of a crawler');
1011+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->previousAll(), '->previousAll() returns a new instance of a crawler');
10121012

10131013
$nodes = $crawler->previousAll();
10141014
$this->assertEquals(2, $nodes->count());
@@ -1026,7 +1026,7 @@ public function testChildren()
10261026
{
10271027
$crawler = $this->createTestCrawler()->filterXPath('//ul');
10281028
$this->assertNotSame($crawler, $crawler->children(), '->children() returns a new instance of a crawler');
1029-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->children() returns a new instance of a crawler');
1029+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->children(), '->children() returns a new instance of a crawler');
10301030

10311031
$nodes = $crawler->children();
10321032
$this->assertEquals(3, $nodes->count());
@@ -1086,7 +1086,7 @@ public function testParents()
10861086
{
10871087
$crawler = $this->createTestCrawler()->filterXPath('//li[1]');
10881088
$this->assertNotSame($crawler, $crawler->parents(), '->parents() returns a new instance of a crawler');
1089-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->parents() returns a new instance of a crawler');
1089+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->parents(), '->parents() returns a new instance of a crawler');
10901090

10911091
$nodes = $crawler->parents();
10921092
$this->assertEquals(3, $nodes->count());

Tests/Html5ParserCrawlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function testAddHtml5()
2727
}
2828

2929
/** @dataProvider validHtml5Provider */
30-
public function testHtml5ParserParseContentStartingWithValidHeading(string $content): void
30+
public function testHtml5ParserParseContentStartingWithValidHeading(string $content)
3131
{
3232
$this->skipTestIfHTML5LibraryNotAvailable();
3333

@@ -41,7 +41,7 @@ public function testHtml5ParserParseContentStartingWithValidHeading(string $cont
4141
}
4242

4343
/** @dataProvider invalidHtml5Provider */
44-
public function testHtml5ParserWithInvalidHeadedContent(string $content): void
44+
public function testHtml5ParserWithInvalidHeadedContent(string $content)
4545
{
4646
$this->skipTestIfHTML5LibraryNotAvailable();
4747

0 commit comments

Comments
 (0)