public function setUp() { vfsStream::setup('public'); mkdir(vfsStream::url('public/js')); parent::setUp(); AssetsLoader::appendSourceDir('tests/files/assets'); AssetsLoader::setDestinationDir(vfsStream::url('public')); }
public function testAssetLoading() { vfsStream::setup('public'); AssetsLoader::appendSourceDir('tests/files/assets'); AssetsLoader::setDestinationDir(vfsStream::url('public')); touch(vfsStream::url('public/existing.css')); $output = TemplateEngine::render('assets.tpl.php', array()); $this->assertEquals("vfs://public/some.css\nvfs://public/another.css\nvfs://public/existing.css", $output); $this->assertFileExists(vfsStream::url('public/some.css')); $this->assertFileExists(vfsStream::url('public/another.css')); }
public static function run() { Session::start(); honam\TemplateEngine::prependPath('views/shared'); honam\TemplateEngine::prependPath('views/layouts'); honam\AssetsLoader::setSiteUrl(Url::path('public')); honam\AssetsLoader::appendSourceDir('assets'); honam\AssetsLoader::setDestinationDir('public'); honam\Helper::setBaseUrl(Url::path('')); self::getRouter()->execute(substr(utils\Input::server('REQUEST_URI'), 1)); }