Skip to content

Commit d0a59b3

Browse files
Merge branch '5.2' into 5.x
* 5.2: Cleanup CI scripts use the clock mock to make test more resilient fix code style fix code style take query and request parameters into account when matching routes mistake throw type error when incompatible types are passed fix tests to run assertions on returned Crawler instances [FrameworkBundle] Fix UidNormalizer priority propagate groups to nested constraints
2 parents 392299a + 2072afb commit d0a59b3

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
@@ -250,7 +250,7 @@ public function testEq()
250250
{
251251
$crawler = $this->createTestCrawler()->filterXPath('//li');
252252
$this->assertNotSame($crawler, $crawler->eq(0), '->eq() returns a new instance of a crawler');
253-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->eq() returns a new instance of a crawler');
253+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->eq(0), '->eq() returns a new instance of a crawler');
254254

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

411411
$crawler = $this->createTestCrawler()->filterXPath('//ul');
412412
$this->assertCount(6, $crawler->filterXPath('//li'), '->filterXPath() filters the node list with the XPath expression');
@@ -573,7 +573,7 @@ public function testFilter()
573573
{
574574
$crawler = $this->createTestCrawler();
575575
$this->assertNotSame($crawler, $crawler->filter('li'), '->filter() returns a new instance of a crawler');
576-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->filter() returns a new instance of a crawler');
576+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->filter('li'), '->filter() returns a new instance of a crawler');
577577

578578
$crawler = $this->createTestCrawler()->filter('ul');
579579

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

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

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

661661
$this->assertEquals(1, $crawler->selectButton('FooValue')->count(), '->selectButton() selects buttons');
662662
$this->assertEquals(1, $crawler->selectButton('FooName')->count(), '->selectButton() selects buttons');
@@ -801,7 +801,7 @@ public function testLinks()
801801

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

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

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

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

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

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

875875
$nodes = $crawler->siblings();
876876
$this->assertEquals(2, $nodes->count());
@@ -993,7 +993,7 @@ public function testNextAll()
993993
{
994994
$crawler = $this->createTestCrawler()->filterXPath('//li')->eq(1);
995995
$this->assertNotSame($crawler, $crawler->nextAll(), '->nextAll() returns a new instance of a crawler');
996-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->nextAll() returns a new instance of a crawler');
996+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->nextAll(), '->nextAll() returns a new instance of a crawler');
997997

998998
$nodes = $crawler->nextAll();
999999
$this->assertEquals(1, $nodes->count());
@@ -1011,7 +1011,7 @@ public function testPreviousAll()
10111011
{
10121012
$crawler = $this->createTestCrawler()->filterXPath('//li')->eq(2);
10131013
$this->assertNotSame($crawler, $crawler->previousAll(), '->previousAll() returns a new instance of a crawler');
1014-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->previousAll() returns a new instance of a crawler');
1014+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->previousAll(), '->previousAll() returns a new instance of a crawler');
10151015

10161016
$nodes = $crawler->previousAll();
10171017
$this->assertEquals(2, $nodes->count());
@@ -1029,7 +1029,7 @@ public function testChildren()
10291029
{
10301030
$crawler = $this->createTestCrawler()->filterXPath('//ul');
10311031
$this->assertNotSame($crawler, $crawler->children(), '->children() returns a new instance of a crawler');
1032-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->children() returns a new instance of a crawler');
1032+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->children(), '->children() returns a new instance of a crawler');
10331033

10341034
$nodes = $crawler->children();
10351035
$this->assertEquals(3, $nodes->count());
@@ -1094,7 +1094,7 @@ public function testParents()
10941094

10951095
$crawler = $this->createTestCrawler()->filterXPath('//li[1]');
10961096
$this->assertNotSame($crawler, $crawler->parents(), '->parents() returns a new instance of a crawler');
1097-
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler, '->parents() returns a new instance of a crawler');
1097+
$this->assertInstanceOf('Symfony\\Component\\DomCrawler\\Crawler', $crawler->parents(), '->parents() returns a new instance of a crawler');
10981098

10991099
$nodes = $crawler->parents();
11001100
$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)