コード例 #1
0
 public function testGetCompiledJsURL()
 {
     $gcc = new GCCompiler($this->app['config']);
     $gcc->setFiles('file1.js');
     $this->assertContains('http://localhost/js-built/', $gcc->getCompiledJsURL());
     $this->app['config']->set('laravel-gcc::build_path', 'other-path');
     $this->assertContains('http://localhost/other-path/', $gcc->getCompiledJsURL());
 }
コード例 #2
0
ファイル: TestRoutes.php プロジェクト: jboysen/laravel-gcc
 public function testRouteCache()
 {
     GCCompiler::cleanup();
     $this->_mockRemoteCompiler();
     $gcc = new GCCompiler($this->app['config']);
     $gcc->compile('file1.js');
     $time = time();
     \File::shouldReceive('exists')->once()->andReturn(true)->shouldReceive('lastModified')->twice()->andReturn($time);
     $this->call('GET', $gcc->getCompiledJsURL(), array(), array(), array('HTTP_If-Modified-Since' => gmdate('D, d M Y H:i:s \\G\\M\\T', $time)));
     $this->assertResponseStatus(304);
 }