/** * testAddHook method * * @return void * @access public */ function testAddHook() { $_hooks = AutopilotShell::$hooks; AutopilotShell::$hooks = array(); $callback = 'sprintf'; $this->Autopilot->addHook(Hooks::green, $callback); $expected = array(Hooks::green => array($callback)); $this->assertEqual(AutopilotShell::$hooks, $expected); AutopilotShell::$hooks = $_hooks; }
/** * addHooks method * * @return void * @access public */ function addHooks() { AutopilotShell::addHook(Hooks::green, array('Notify', 'green')); AutopilotShell::addHook(Hooks::red, array('Notify', 'red')); AutopilotShell::addHook(Hooks::all_good, array('Notify', 'allGood')); }