public function testLimitWithStart() { $p_h = $this->getMock('PancakeTF_PermissionHandlerI', array('doesHavePermission')); $p_h->expects($this->any())->method('doesHavePermission')->will($this->returnValue(true)); $forum = new PancakeTF_Forum($this->db, $p_h, 1, array('limit' => 1, 'start' => 1)); $this->assertEquals(count($forum->getMessages()), 2); }
public function __construct($id, $options = array()) { if (false === is_null($options['dba']) || false === $options['dba'] instanceof PancakeTF_DBAccessI) { $dba = new PancakeTF_ShusterDB(lib_dbutils_ShusterDb::getInstance()); } else { $dba = $options['dba']; } if (false === isset($options['handler']) || false === $options['handler'] instanceof PancakeTF_PermissionHandlerI) { $ph = new PancakeTF_ForumPermissionHandler($dba); } else { $ph = $options['handler']; } parent::__construct($dba, $ph, $id, $options); }
public function __call($name, $params) { if (substr($name, 0, 7) === 'public_') { $name = substr($name, 7); if (method_exists($this, $name)) { return call_user_func_array(array($this, $name), $params); } } $parents = class_parents($this); if (is_array($parents)) { foreach ($parents as $classname) { if (method_exists($classname, '__call')) { return parent::__call($name, $params); } } } throw new Exception("Method {$name} does not exist for this class"); }