Skip to content

Commit

Permalink
Add tests for Table::saveMany()
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Apr 17, 2016
1 parent 7409323 commit 453f3c2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/TestCase/ORM/TableTest.php
Expand Up @@ -2777,6 +2777,24 @@ public function testUpdateNoPrimaryButOtherKeys()
$this->assertSame($entity, $table->save($entity));
}

/**
* Test saveMany() with entities array
*
* @return void
*/
public function testSaveManyArray()
{
$entities = [
new Entity(['name' => 'admad']),
new Entity(['name' => 'dakota'])
];

$table = TableRegistry::get('authors');
$result = $table->saveMany($entities);
$this->assertSame($entities, $result);
$this->assertTrue(isset($result[0]->id));
}

/**
* Test simple delete.
*
Expand Down

0 comments on commit 453f3c2

Please sign in to comment.