Skip to content

Commit

Permalink
Db: renamed to seeNumrecords
Browse files Browse the repository at this point in the history
  • Loading branch information
DavertMik committed Jun 29, 2015
1 parent 3cbb9ac commit db2da77
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -34,6 +34,7 @@
* Official extensions moved to `ext` dir; Base Extension class renamed to `Codeception\Extension`
* Duplicate environment options won't cause Codeception to run environment tests twice
* [Phalcon1] `haveServiceInDi` method implemented by @sergeyklay
* [Db] `seeNumRecords` method added by @sergeyklay

#### 2.0.15

Expand Down
4 changes: 2 additions & 2 deletions src/Codeception/Module/Db.php
Expand Up @@ -302,15 +302,15 @@ public function seeInDatabase($table, $criteria = [])
*
* ``` php
* <?php
* $I->seeNumRecord(1, 'users', ['name' => 'davert'])
* $I->seeNumRecords(1, 'users', ['name' => 'davert'])
* ?>
* ```
*
* @param int $num Expected number
* @param string $table Table name
* @param array $criteria Search criteria [Optional]
*/
public function seeNumRecord($num, $table, array $criteria = [])
public function seeNumRecords($num, $table, array $criteria = [])
{
$res = $this->countInDatabase($table, $criteria);
$this->assertEquals($num, $res, 'The number of found rows is not consistent with the asserting');
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/Codeception/Module/DbTest.php
Expand Up @@ -35,9 +35,9 @@ public function testSeeInDatabase()

public function testCountInDatabase()
{
self::$module->seeNumRecord(1, 'users', ['name' => 'davert']);
self::$module->seeNumRecord(0, 'users', ['name' => 'davert', 'email' => 'xxx@yyy.zz']);
self::$module->seeNumRecord(0, 'users', ['name' => 'user1']);
self::$module->seeNumRecords(1, 'users', ['name' => 'davert']);
self::$module->seeNumRecords(0, 'users', ['name' => 'davert', 'email' => 'xxx@yyy.zz']);
self::$module->seeNumRecords(0, 'users', ['name' => 'user1']);
}

public function testDontSeeInDatabase()
Expand Down

0 comments on commit db2da77

Please sign in to comment.