public function testPostUpdate() { $t = new Table3(); $t->postUpdate = 0; $t->save(); $this->assertEquals($t->postUpdate, 0, 'postUpdate hook is not called on object insertion'); $t->postUpdate = 0; $t->setTitle('foo'); $t->save(); $this->assertEquals($t->postUpdate, 1, 'postUpdate hook is called on object modification'); $this->assertEquals($t->postUpdateBuilder, 'PHP5ObjectBuilder', 'postUpdate hook is called with the object builder as parameter'); $this->assertTrue($t->postUpdateIsAfterSave, 'postUpdate hook is called after save'); }
public function testPostUpdate() { $t = new Table3(); $t->postUpdate = 0; $t->save(); $this->assertEquals($t->postUpdate, 0, 'postUpdate hook is not called on object insertion'); $t->postUpdate = 0; $t->setTitle('foo'); $t->save(); $this->assertEquals($t->postUpdate, 1, 'postUpdate hook is called on object modification'); $this->assertTrue($t->postUpdateIsAfterSave, 'postUpdate hook is called after save'); }