Browse Source

Add more coverage.

Mark Story 8 years ago
parent
commit
73e07a1a48
1 changed files with 29 additions and 0 deletions
  1. 29 0
      tests/TestCase/ORM/EagerLoaderTest.php

+ 29 - 0
tests/TestCase/ORM/EagerLoaderTest.php

@@ -560,6 +560,35 @@ class EagerLoaderTest extends TestCase
     }
 
     /**
+     * Test for autoFields()
+     *
+     * @group deprecated
+     * @return void
+     */
+    public function testAutoFields()
+    {
+        $this->deprecated(function () {
+            $loader = new EagerLoader();
+            $this->assertTrue($loader->autoFields());
+            $this->assertFalse($loader->autoFields(false));
+            $this->assertFalse($loader->autoFields());
+        });
+    }
+
+    /**
+     * Test for enableAutoFields()
+     *
+     * @return void
+     */
+    public function testEnableAutoFields()
+    {
+        $loader = new EagerLoader();
+        $this->assertTrue($loader->isAutoFieldsEnabled());
+        $this->assertSame($loader, $loader->enableAutoFields(false));
+        $this->assertFalse($loader->isAutoFieldsEnabled());
+    }
+
+    /**
      * Helper function sued to quoted both keys and values in an array in case
      * the test suite is running with auto quoting enabled
      *