public function testPkLessMeta() { $expected = new Meta(); $expected->table = 'pkless'; $expected->class = 'Phormium\\Tests\\Models\\PkLess'; $expected->database = 'testdb'; $expected->columns = array('foo', 'bar', 'baz'); $expected->pk = null; $expected->nonPK = array('foo', 'bar', 'baz'); $actual = PkLess::getMeta(); $this->assertEquals($expected, $actual); }
/** * @expectedException \Exception * @expectedExceptionMessage Model not writable because primary key is not defined in _meta. */ public function testSaveModelWithoutPrimaryKey() { $pkl = new PkLess(); $pkl->save(); }