/** * @return SmartyWrapper */ public function getSmarty() { $smarty = new SmartyWrapper($this); $smarty->addTemplateDir(__DIR__ . '/../tpl'); $smarty->addTemplateDir($this->getDataDirectory() . '/tpl'); $smarty->registerObject('PWE', $this); try { $smarty->registerObject('URL', $this->getURL()); } catch (HTTP4xxException $e) { PWELogger::warn("Failed to set URL for smarty: %s", $e); } $smarty->registerObject('AUTH', PWEUserAuthController::getAuthControllerInstance($this)); return $smarty; }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { $this->object = new SmartyWrapper(new UnitTestPWECore()); $this->object->addTemplateDir('.'); }