Browse Source

Adding a test for Table::getSaveOptionsBuilder()

Florian Krämer 9 years ago
parent
commit
61dd97e723
2 changed files with 14 additions and 2 deletions
  1. 2 2
      src/ORM/Table.php
  2. 12 0
      tests/TestCase/ORM/TableTest.php

+ 2 - 2
src/ORM/Table.php

@@ -2373,9 +2373,9 @@ class Table implements RepositoryInterface, EventListenerInterface, EventDispatc
      *
      * @return \Cake\ORM\SaveOptionsBuilder
      */
-    public function getSaveOptionsBuilder()
+    public function getSaveOptionsBuilder(array $options = [])
     {
-        return new SaveOptionsBuilder();
+        return new SaveOptionsBuilder($this, $options);
     }
 
     /**

+ 12 - 0
tests/TestCase/ORM/TableTest.php

@@ -6012,6 +6012,18 @@ class TableTest extends TestCase
     }
 
     /**
+     * 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.
      *
      * @return void