Skip to content

Commit 8298ff8

Browse files
committed
Add other assertion tests
1 parent 0a6961a commit 8298ff8

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tests/AssertsTest.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,38 @@ public function testAssertJsonSubsets()
4949

5050
$this->assertJsonSubsets($expected, $expected2, $actual);
5151
}
52+
53+
public function testAssertFloatEquals()
54+
{
55+
$expected = 5.6;
56+
57+
$actual = 2.8 + 2.8;
58+
59+
$this->assertFloatEquals($expected, $actual);
60+
}
61+
62+
public function testAssertArrayHasKeys()
63+
{
64+
$expectedKeys = ['key1', 'key2'];
65+
66+
$array = [
67+
'key1' => 'value1',
68+
'key2' => 'value2',
69+
];
70+
71+
$this->assertArrayHasKeys($expectedKeys, $array);
72+
}
73+
74+
public function testAssertAll()
75+
{
76+
$expectations = [
77+
'equals' => 1,
78+
'lessThan' => 10,
79+
'greaterThan' => 0,
80+
];
81+
82+
$actual = 1;
83+
84+
$this->assertAll($expectations, $actual);
85+
}
5286
}

0 commit comments

Comments
 (0)