Skip to content

Commit 01661dd

Browse files
committed
[Asserts] Added specialized assertEquals methods
1 parent 539bf12 commit 01661dd

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/Codeception/Module/Asserts.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ class Asserts extends CodeceptionModule
1212
use SharedAsserts {
1313
assertEquals as public;
1414
assertNotEquals as public;
15+
assertEqualsCanonicalizing as public;
16+
assertNotEqualsCanonicalizing as public;
17+
assertEqualsIgnoringCase as public;
18+
assertNotEqualsIgnoringCase as public;
19+
assertEqualsWithDelta as public;
20+
assertNotEqualsWithDelta as public;
1521
assertSame as public;
1622
assertNotSame as public;
1723
assertGreaterThan as public;

tests/unit/Codeception/Module/AssertsTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ public function testAsserts()
6969
$this->module->assertIsNotString(false);
7070
$this->module->assertIsNotScalar(function() {});
7171
$this->module->assertIsNotCallable('test');
72+
73+
$this->module->assertEqualsCanonicalizing([3, 2, 1], [1, 2, 3]);
74+
$this->module->assertNotEqualsCanonicalizing([3, 2, 1], [2, 3, 0, 1]);
75+
$this->module->assertEqualsIgnoringCase('foo', 'FOO');
76+
$this->module->assertNotEqualsIgnoringCase('foo', 'BAR');
77+
$this->module->assertEqualsWithDelta(1.0, 1.01, 0.1);
78+
$this->module->assertNotEqualsWithDelta(1.0, 1.5, 0.1);
7279
}
7380

7481
public function testExceptions()

0 commit comments

Comments
 (0)