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()); }
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); }