Skip to content

Commit af5f7d3

Browse files
minor symfony#28025 Use an empty string as default for assertEquals (DavidPrevot)
This PR was merged into the 3.4 branch. Discussion ---------- Use an empty string as default for assertEquals Make sure it isn’t interpreted as a type NULL, making the test fail with PHPUnit 7.2. | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT This shouldn’t break the existing tests, but will also make them work with recent PHPUnit. Commits ------- 3135314 Use an empty string as default for assertEquals
2 parents 7b80bc2 + 3135314 commit af5f7d3

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function testCreateMapFinderSupport()
138138
), ClassMapGenerator::createMap($finder));
139139
}
140140

141-
protected function assertEqualsNormalized($expected, $actual, $message = null)
141+
protected function assertEqualsNormalized($expected, $actual, $message = '')
142142
{
143143
foreach ($expected as $ns => $path) {
144144
$expected[$ns] = str_replace('\\', '/', $path);

src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ public function testParents()
10271027
/**
10281028
* @dataProvider getBaseTagData
10291029
*/
1030-
public function testBaseTag($baseValue, $linkValue, $expectedUri, $currentUri = null, $description = null)
1030+
public function testBaseTag($baseValue, $linkValue, $expectedUri, $currentUri = null, $description = '')
10311031
{
10321032
$crawler = new Crawler('<html><base href="'.$baseValue.'"><a href="'.$linkValue.'"></a></html>', $currentUri);
10331033
$this->assertEquals($expectedUri, $crawler->filterXPath('//a')->link()->getUri(), $description);

src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function testDuration()
7373
$event->start();
7474
usleep(200000);
7575
$event->stop();
76-
$this->assertEquals(200, $event->getDuration(), null, self::DELTA);
76+
$this->assertEquals(200, $event->getDuration(), '', self::DELTA);
7777

7878
$event = new StopwatchEvent(microtime(true) * 1000);
7979
$event->start();
@@ -83,15 +83,15 @@ public function testDuration()
8383
$event->start();
8484
usleep(100000);
8585
$event->stop();
86-
$this->assertEquals(200, $event->getDuration(), null, self::DELTA);
86+
$this->assertEquals(200, $event->getDuration(), '', self::DELTA);
8787
}
8888

8989
public function testDurationBeforeStop()
9090
{
9191
$event = new StopwatchEvent(microtime(true) * 1000);
9292
$event->start();
9393
usleep(200000);
94-
$this->assertEquals(200, $event->getDuration(), null, self::DELTA);
94+
$this->assertEquals(200, $event->getDuration(), '', self::DELTA);
9595

9696
$event = new StopwatchEvent(microtime(true) * 1000);
9797
$event->start();
@@ -100,7 +100,7 @@ public function testDurationBeforeStop()
100100
usleep(50000);
101101
$event->start();
102102
usleep(100000);
103-
$this->assertEquals(100, $event->getDuration(), null, self::DELTA);
103+
$this->assertEquals(100, $event->getDuration(), '', self::DELTA);
104104
}
105105

106106
/**
@@ -134,7 +134,7 @@ public function testEnsureStopped()
134134
$event->start();
135135
usleep(100000);
136136
$event->ensureStopped();
137-
$this->assertEquals(300, $event->getDuration(), null, self::DELTA);
137+
$this->assertEquals(300, $event->getDuration(), '', self::DELTA);
138138
}
139139

140140
public function testStartTime()
@@ -151,7 +151,7 @@ public function testStartTime()
151151
$event->start();
152152
usleep(100000);
153153
$event->stop();
154-
$this->assertEquals(0, $event->getStartTime(), null, self::DELTA);
154+
$this->assertEquals(0, $event->getStartTime(), '', self::DELTA);
155155
}
156156

157157
/**

src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function testStop()
7979
$event = $stopwatch->stop('foo');
8080

8181
$this->assertInstanceOf('Symfony\Component\Stopwatch\StopwatchEvent', $event);
82-
$this->assertEquals(200, $event->getDuration(), null, self::DELTA);
82+
$this->assertEquals(200, $event->getDuration(), '', self::DELTA);
8383
}
8484

8585
/**

src/Symfony/Component/Yaml/Tests/Fixtures/escapedCharacters.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ yaml: |
44
php: |
55
"\\0 \\ \\a \\b \\n"
66
---
7-
test: null
7+
test: 'null'
88
yaml: |
99
"\0"
1010
php: |

0 commit comments

Comments
 (0)