/** * The autoloader for the test-cases * * @param string $item the item to load * @return boolean whether the file has been loaded */ function PC_UnitTest_autoloader($item) { if (FWS_String::starts_with($item, 'PC_Tests_')) { $item = FWS_String::substr($item, FWS_String::strlen('PC_Tests_')); $path = 'tests/' . FWS_String::strtolower($item) . '.php'; if (is_file($path)) { include $path; return true; } } return false; }
/** * @see BS_Page::before_start() */ protected function before_start() { parent::before_start(); $doc = FWS_Props::get()->doc(); // set the default template if not already done $template = ''; if ($this->get_template() === null) { $classname = get_class($doc->get_module()); $prefixlen = FWS_String::strlen('TDL_Module_'); $template = FWS_String::strtolower(FWS_String::substr($classname, $prefixlen)) . '.htm'; $this->set_template($template); } }