コード例 #1
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);
 }
コード例 #2
0
 public function testWithoutMocks()
 {
     GCCompiler::cleanup();
     $first = \File::glob(GCCompiler::storagePath(DIRECTORY_SEPARATOR . '*'));
     $this->assertEquals(0, count($first));
     $gcc = new GCCompiler($this->app['config']);
     $this->assertTrue($gcc->compile('file1.js'));
     $second = \File::glob(GCCompiler::storagePath(DIRECTORY_SEPARATOR . '*'));
     $this->assertEquals(1, count($second));
 }