function testBeforeValidate() { Model3::addEvent("before_validate", array($this, 'hook_test_before_validate')); $c = new Model3(); $c->a = 'cesar'; $c->int = rand(1, 50); $c->save(); $this->assertEquals($c->b, md5($c->a)); $this->assertNotEquals($c->getID(), ""); /**/ $c->a = 'rodas'; $c->save(); $this->assertEquals($c->b, md5($c->a)); }
function testToSTring() { $c = new Model3(); $c->doQuery(); $this->assertEquals((string) $c, (string) $c->getID()); $this->assertEquals((string) $c, $c->key()); }