/** * Check schema() on a model with useTable = false; * * @return void */ public function testSchemaUseTableFalse() { $model = new TheVoid(); $result = $model->schema(); $this->assertNull($result); $result = $model->create(); $this->assertEmpty($result); }
/** * test that validates() still performs correctly when useTable = false on the model. * * @return void */ public function testValidatesWithNoTable() { $TestModel = new TheVoid(); $TestModel->validate = array('title' => array('notEmpty' => array('rule' => array('notBlank'), 'required' => true), 'tooShort' => array('rule' => array('minLength', 10)))); $data = array('TheVoid' => array('title' => 'too short')); $TestModel->create($data); $result = $TestModel->validates(); $this->assertFalse($result); $data = array('TheVoid' => array('id' => '1', 'title' => 'A good title')); $TestModel->create($data); $result = $TestModel->validates(); $this->assertTrue($result); }