/** * Wraps objects returned from fetch in the named Decorator class * @param string name of Decorator class to wrap with * @return object instance of named decorator * @access public */ function &fetch($decorator) { $Calendar = parent::fetch(); if ($Calendar) { return new $decorator($Calendar); } else { return false; } }
/** * Wraps objects returned from fetch in the named Decorator class * @param string name of Decorator class to wrap with * @return object instance of named decorator * @access public */ function &fetch($decorator) { $Calendar = parent::fetch(); if ($Calendar) { $ret =& new $decorator($Calendar); } else { $ret = false; } return $ret; }
function testFetch() { $this->mockcal->expectOnce('fetch', array()); $Decorator = new Calendar_Decorator($this->mockcal); $Decorator->fetch(); }