public function testPublicUrl() { $app = $this->getApp(); $app->getTemplateEngine()->loadPlugin('smarty_function_theme_url'); ob_start(); $app->runControllerFromRawUrl('themes/testPublicUrl'); $output = ob_get_clean(); $this->assertEquals($app->config('baseUrl') . 'public/images/test.jpg', $output); ob_start(); $app->runControllerFromRawUrl('themes/testPublicUrlArgs'); $output = ob_get_clean(); $this->assertEquals($app->config('baseUrl') . 'public/images/test.jpg?arg=arg1', $output); unsetRealpath(); }
public function testGetLanguageByRunningController() { $app = $this->getApp(); setRealpath(); ob_start(); $app->runControllerFromRawUrl('plugins/lang'); $output = ob_get_clean(); unsetRealpath(); $file = 'vfs://root/public/default/App/languages/en/plugins/_pluginsLang.json'; $this->assertTrue(file_exists($file)); $json = file_get_contents($file); $this->assertFalse(empty($json)); $json_r = json_decode($json, true); $this->assertEquals('app default en', $json_r['three']); $this->assertEquals('app default en', $output); }
/** * @expectedException \Skully\Exceptions\InvalidTemplateException * @expectedExceptionCode 99 */ public function testSmartyInvalidTemplateError() { $app = $this->getApp(); $app->runControllerFromRawUrl('home/error'); unsetRealpath(); }