/** * +-- ForceCompileでcompileFile * * @access public * @return void */ public function SimpleCompileFileTest() { $symple_test_config = $this->parseYml('unit_tests_config.yml', 'simple_test'); $EnviScssphpExtension = new EnviScssphpExtension($symple_test_config); $res = $EnviScssphpExtension->compileFile($this->test_data_dir . 'simple_test.scss', 'test'); $this->assertEquals(file_get_contents($this->test_data_dir . 'simple_test.scss.css'), $res); }
/** * +-- cache有りCompileでcompileFile * * @access public * @return void */ public function CachedCompileFileTest() { $symple_test_config = $this->parseYml('unit_tests_config.yml', 'cached_test'); $EnviScssphpExtension = new EnviScssphpExtension($symple_test_config); $res = $EnviScssphpExtension->compileFile($this->test_data_dir . 'simple_test.scss', 'test'); $this->assertEquals(file_get_contents($this->test_data_dir . 'simple_test.scss.min.css'), $res); $this->assertFileExists($this->test_data_dir . 'scss_php_cache_test_1.0_unittest.css.envicc'); // 再コンパイルしてみる $res2 = $EnviScssphpExtension->compileFile($this->test_data_dir . 'simple_test.scss', 'test'); $this->assertEquals($res2, $res); // 再コンパイルしてみる file_put_contents($this->test_data_dir . 'scss_php_cache_test_1.0_unittest.css.envicc', '1234'); $res3 = $EnviScssphpExtension->compile(file_get_contents($this->test_data_dir . 'simple_test.scss'), 'test'); $this->assertNotEquals($res3, $res); }