Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit87c8561

Browse files
minor#32968 Use assertEqualsWithDelta when needed (jderusse)
This PR was merged into the 3.4 branch.Discussion----------Use assertEqualsWithDelta when needed| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#32844| License | MIT| Doc PR | NAThis PR replaces deprecated paramèter `$delta` of methods `assertEquals` by the dedicated method `assertEqualsWithDelta`Commits-------3a0a901 Use assertEqualsWithDelta when required
2 parents443e923 +3a0a901 commit87c8561

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

‎src/Symfony/Component/HttpFoundation/Tests/CookieTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function testGetExpiresTimeWithStringValue()
119119
$cookie =newCookie('foo','bar',$value);
120120
$expire =strtotime($value);
121121

122-
$this->assertEquals($expire,$cookie->getExpiresTime(),'->getExpiresTime() returns the expire date',1);
122+
$this->assertEqualsWithDelta($expire,$cookie->getExpiresTime(),1,'->getExpiresTime() returns the expire date');
123123
}
124124

125125
publicfunctiontestGetDomain()

‎src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ public function testParseTypeDouble($value, $expectedValue)
806806
{
807807
$formatter =$this->getNumberFormatter('en', NumberFormatter::DECIMAL);
808808
$parsedValue =$formatter->parse($value, NumberFormatter::TYPE_DOUBLE);
809-
$this->assertEquals($expectedValue,$parsedValue,'',0.001);
809+
$this->assertEqualsWithDelta($expectedValue,$parsedValue,0.001);
810810
}
811811

812812
publicfunctionparseTypeDoubleProvider()

‎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(),'',self::DELTA);
76+
$this->assertEqualsWithDelta(200,$event->getDuration(),self::DELTA);
7777

7878
$event =newStopwatchEvent(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(),'',self::DELTA);
86+
$this->assertEqualsWithDelta(200,$event->getDuration(),self::DELTA);
8787
}
8888

8989
publicfunctiontestDurationBeforeStop()
9090
{
9191
$event =newStopwatchEvent(microtime(true) *1000);
9292
$event->start();
9393
usleep(200000);
94-
$this->assertEquals(200,$event->getDuration(),'',self::DELTA);
94+
$this->assertEqualsWithDelta(200,$event->getDuration(),self::DELTA);
9595

9696
$event =newStopwatchEvent(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(),'',self::DELTA);
103+
$this->assertEqualsWithDelta(100,$event->getDuration(),self::DELTA);
104104
}
105105

106106
publicfunctiontestStopWithoutStart()
@@ -132,7 +132,7 @@ public function testEnsureStopped()
132132
$event->start();
133133
usleep(100000);
134134
$event->ensureStopped();
135-
$this->assertEquals(300,$event->getDuration(),'',self::DELTA);
135+
$this->assertEqualsWithDelta(300,$event->getDuration(),self::DELTA);
136136
}
137137

138138
publicfunctiontestStartTime()
@@ -149,7 +149,7 @@ public function testStartTime()
149149
$event->start();
150150
usleep(100000);
151151
$event->stop();
152-
$this->assertEquals(0,$event->getStartTime(),'',self::DELTA);
152+
$this->assertEqualsWithDelta(0,$event->getStartTime(),self::DELTA);
153153
}
154154

155155
publicfunctiontestInvalidOriginThrowsAnException()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp