Skip to content
Permalink
Browse files

Fixing tests and CS errors

  • Loading branch information...
lorenzo committed Jul 9, 2016
1 parent 3be1067 commit eff290207e39897039d87c060c2786e8415a8f10
Showing with 9 additions and 5 deletions.
  1. +7 −4 tests/TestCase/ORM/TableRegressionTest.php
  2. +2 −1 tests/TestCase/ORM/TableTest.php
@@ -52,15 +52,18 @@ public function tearDown()
* in the afterSave callback
*
* @see https://github.com/cakephp/cakephp/issues/9079
* @expectedException \Cake\ORM\RolledbackTransactionException
* @expectedException Cake\ORM\Exception\RolledbackTransactionException
* @return void
*/
public function testAfterSaveRollbackTransaction()
{
$table = TableRegistry::get('Authors');
$table->eventManager()->on('Model.afterSave', function () use ($table) {
$table->connection()->rollback();
});
$table->eventManager()->on(
'Model.afterSave',
function () use ($table) {
$table->connection()->rollback();
}
);
$entity = $table->newEntity(['name' => 'Jon']);
$table->save($entity);
}
@@ -2427,7 +2427,7 @@ public function testAtomicSave()
$config = ConnectionManager::config('test');
$connection = $this->getMockBuilder('\Cake\Database\Connection')
->setMethods(['begin', 'commit'])
->setMethods(['begin', 'commit', 'inTransaction'])
->setConstructorArgs([$config])
->getMock();
$connection->driver($this->connection->driver());
@@ -2441,6 +2441,7 @@ public function testAtomicSave()
$connection->expects($this->once())->method('begin');
$connection->expects($this->once())->method('commit');
$connection->expects($this->any())->method('inTransaction')->will($this->returnValue(true));
$data = new \Cake\ORM\Entity([
'username' => 'superuser',
'created' => new Time('2013-10-10 00:00'),

0 comments on commit eff2902

Please sign in to comment.
You can’t perform that action at this time.