/** * Test that the old compiled file is removed when the org source * has changed, i.e. the timestamp has been updated in this case */ public function testCompileWithChange() { // clean sheet GCCompiler::cleanup(); $this->_mockRemoteCompiler(); // compile one time $gcc = new GCCompiler($this->app['config']); $this->assertEquals($gcc->compile('file1.js'), true); $first = \File::glob(GCCompiler::storagePath(DIRECTORY_SEPARATOR . '*')); $this->assertEquals(1, count($first)); touch(public_path('js') . '/file1.js'); // compile again (file has changed) $this->_mockRemoteCompiler(); $gcc->reset(); $this->assertEquals($gcc->compile('file1.js'), true); $second = \File::glob(GCCompiler::storagePath(DIRECTORY_SEPARATOR . '*')); $this->assertEquals(1, count($second)); $this->assertNotEquals($first[0], $second[0]); }