Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding a test for Table::getSaveOptionsBuilder()
  • Loading branch information
Florian Krämer committed Jul 20, 2016
1 parent e3295ee commit 61dd97e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ORM/Table.php
Expand Up @@ -2373,9 +2373,9 @@ public function buildRules(RulesChecker $rules)
*
* @return \Cake\ORM\SaveOptionsBuilder
*/
public function getSaveOptionsBuilder()
public function getSaveOptionsBuilder(array $options = [])
{
return new SaveOptionsBuilder();
return new SaveOptionsBuilder($this, $options);
}

/**
Expand Down
12 changes: 12 additions & 0 deletions tests/TestCase/ORM/TableTest.php
Expand Up @@ -6011,6 +6011,18 @@ public function testLoadIntoMany()
$this->assertEquals($expected, $result);
}

/**
* Test getting the save options builder.
*
* @return void
*/
public function getSaveOptionsBuilder()
{
$table = TableRegistry::get('Authors');
$result = $table->getSaveOptionsBuilder();
$this->assertInstanceOf('Cake\ORM\SaveOptionsBuilder', $result);
}

/**
* Helper method to skip tests when connection is SQLServer.
*
Expand Down

0 comments on commit 61dd97e

Please sign in to comment.