Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: use assertEqualsWithDelta for ratio calculations in EmbedCodeTest
  • Loading branch information
uzulla committed Oct 6, 2025
commit a386551fc847f31863e8ca4ec3afe11cbafef212
4 changes: 2 additions & 2 deletions tests/EmbedCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function testRatioCalculationNormal()
{
// Normal case: width=380, height=120
$code = new EmbedCode('<iframe></iframe>', 380, 120);
$this->assertEquals(31.579, $code->ratio);
$this->assertEqualsWithDelta(31.579, $code->ratio, 0.001);
}

public function testRatioCalculationWithNullWidth()
Expand Down Expand Up @@ -65,7 +65,7 @@ public function testJsonSerialize()
$this->assertEquals('<div>test</div>', $json['html']);
$this->assertEquals(640, $json['width']);
$this->assertEquals(480, $json['height']);
$this->assertEquals(75.0, $json['ratio']);
$this->assertEqualsWithDelta(75.0, $json['ratio'], 0.001);
}

public function testToString()
Expand Down