Browse Source

Prevent accidental configuration of both model and table.

Mark Scherer 10 years ago
parent
commit
530def4d3d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/TestSuite/Fixture/TestFixture.php

+ 3 - 0
src/TestSuite/Fixture/TestFixture.php

@@ -200,6 +200,9 @@ class TestFixture implements FixtureInterface
         $import = $this->import + ['connection' => 'default', 'table' => null, 'model' => null];
 
         if (!empty($import['model'])) {
+            if (!empty($import['table'])) {
+                throw new CakeException('You cannot define both table and model.');
+            }
             $import['table'] = TableRegistry::get($import['model'])->table();
         }