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

Commit a386551

Browse files
committed
test: use assertEqualsWithDelta for ratio calculations in EmbedCodeTest
1 parent c128a80 commit a386551

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎tests/EmbedCodeTest.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function testRatioCalculationNormal()
1212
{
1313
// Normal case: width=380, height=120
1414
$code = new EmbedCode('<iframe></iframe>', 380, 120);
15-
$this->assertEquals(31.579, $code->ratio);
15+
$this->assertEqualsWithDelta(31.579, $code->ratio, 0.001);
1616
}
1717

1818
public function testRatioCalculationWithNullWidth()
@@ -65,7 +65,7 @@ public function testJsonSerialize()
6565
$this->assertEquals('<div>test</div>', $json['html']);
6666
$this->assertEquals(640, $json['width']);
6767
$this->assertEquals(480, $json['height']);
68-
$this->assertEquals(75.0, $json['ratio']);
68+
$this->assertEqualsWithDelta(75.0, $json['ratio'], 0.001);
6969
}
7070

7171
public function testToString()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /