Skip to content

Commit c228846

Browse files
AleksandrDavertMik
authored andcommitted
Added assertCount to Asserts module (#3802)
1 parent fbd153b commit c228846

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/Codeception/Module/Asserts.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,16 @@ public function assertArrayNotHasKey($key, $actual, $description = '')
292292
parent::assertArrayNotHasKey($key, $actual, $description);
293293
}
294294

295+
/**
296+
* @param $expectedCount
297+
* @param $actual
298+
* @param $description
299+
*/
300+
public function assertCount($expectedCount, $actual, $description = '')
301+
{
302+
parent::assertCount($expectedCount, $actual, $description);
303+
}
304+
295305
/**
296306
* @param $class
297307
* @param $actual

tests/unit/Codeception/Module/AssertsTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public function testAsserts()
2323
$module->assertInstanceOf('Exception', new Exception());
2424
$module->assertInternalType('integer', 5);
2525
$module->assertArrayHasKey('one', ['one' => 1, 'two' => 2]);
26+
$module->assertCount(3, [1, 2, 3]);
2627
}
2728

2829
public function testExceptions()

0 commit comments

Comments
 (0)