/** * Tests whether getID never produces a notice. * * @return void */ public function testGetIDShouldNeverPrintNotice() { set_error_handler(function ($err, $errStr) { die('>>>>FAIL :' . $err . ' ' . $errStr); }); $bean = new OODBBean(); $bean->getID(); restore_error_handler(); pass(); }
/** * Generates a key from the bean type and its ID and determines if the bean * occurs in the trail, if not the bean will be added to the trail. * Returns TRUE if the bean occurs in the trail and FALSE otherwise. * * @param array $trail list of former beans * @param OODBBean $bean currently selected bean * * @return boolean */ private function inTrailOrAdd(&$trail, OODBBean $bean) { $type = $bean->getMeta('type'); $key = $type . $bean->getID(); if (isset($trail[$key])) { return TRUE; } $trail[$key] = $bean; return FALSE; }