public function testAfterSaveEntityHook() { $mapper = test_spot_mapper(); $post = new Entity_Post(array('title' => 'A title', 'body' => '<p>body</p>', 'status' => 1, 'author_id' => 1, 'date_created' => new \DateTime())); $i = $post->status; Entity_Post::$hooks = array('afterSave' => array('mock_save_hook')); $mapper->save($post); $this->assertEquals($i + 1, $post->status); }