|
|
@@ -65,7 +65,7 @@ class CakeTestFixtureTestFixture extends CakeTestFixture {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * StringFieldsTestFixture class
|
|
|
+ * StringTestFixture class
|
|
|
*
|
|
|
* @package Cake.Test.Case.TestSuite
|
|
|
*/
|
|
|
@@ -110,6 +110,50 @@ class StringsTestFixture extends CakeTestFixture {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * InvalidTestFixture class
|
|
|
+ *
|
|
|
+ * @package Cake.Test.Case.TestSuite
|
|
|
+ */
|
|
|
+class InvalidTestFixture extends CakeTestFixture {
|
|
|
+
|
|
|
+/**
|
|
|
+ * Name property
|
|
|
+ *
|
|
|
+ * @var string
|
|
|
+ */
|
|
|
+ public $name = 'Invalid';
|
|
|
+
|
|
|
+/**
|
|
|
+ * Table property
|
|
|
+ *
|
|
|
+ * @var string
|
|
|
+ */
|
|
|
+ public $table = 'invalid';
|
|
|
+
|
|
|
+/**
|
|
|
+ * Fields array - missing "email" row
|
|
|
+ *
|
|
|
+ * @var array
|
|
|
+ */
|
|
|
+ public $fields = array(
|
|
|
+ 'id' => array('type' => 'integer', 'key' => 'primary'),
|
|
|
+ 'name' => array('type' => 'string', 'length' => '255'),
|
|
|
+ 'age' => array('type' => 'integer', 'default' => 10)
|
|
|
+ );
|
|
|
+
|
|
|
+/**
|
|
|
+ * Records property
|
|
|
+ *
|
|
|
+ * @var array
|
|
|
+ */
|
|
|
+ public $records = array(
|
|
|
+ array('name' => 'Mark Doe', 'email' => 'mark.doe@email.com'),
|
|
|
+ array('name' => 'John Doe', 'email' => 'john.doe@email.com', 'age' => 20),
|
|
|
+ array('email' => 'jane.doe@email.com', 'name' => 'Jane Doe', 'age' => 30)
|
|
|
+ );
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
* CakeTestFixtureImportFixture class
|
|
|
*
|
|
|
* @package Cake.Test.Case.TestSuite
|
|
|
@@ -483,6 +527,17 @@ class CakeTestFixtureTest extends CakeTestCase {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * test the insert method with invalid fixture
|
|
|
+ *
|
|
|
+ * @expectedException CakeException
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function testInsertInvalid() {
|
|
|
+ $Fixture = new InvalidTestFixture();
|
|
|
+ $return = $Fixture->insert($this->criticDb);
|
|
|
+ }
|
|
|
+
|
|
|
+/**
|
|
|
* Test the drop method
|
|
|
*
|
|
|
* @return void
|