/** * @rebuild false * @expectedException LazyRecord\QueryException */ public function testTitleIsRequired() { $b = new \AuthorBooks\Model\Book(); $ret = $b->find(array('name' => 'LoadOrCreateTest')); $this->assertResultFail($ret); $this->assertNull($b->id); }
/** * @rebuild false */ public function testZeroInflator() { $b = new \AuthorBooks\Model\Book(); $ret = $b->create(array('title' => 'Zero number inflator', 'view' => 0)); $this->assertResultSuccess($ret); $this->assertNotNull($b->id); $this->assertEquals(0, $b->view); $ret = $b->find($ret->id); $this->assertResultSuccess($ret); $this->assertNotNull($b->id); $this->assertEquals(0, $b->view); $this->successfulDelete($b); }