public function write(AssetTarget $build, $content)
{
$ext = $build->ext();
$path = $build->outputDir();
if (!is_writable($path)) {
throw new RuntimeException('Cannot write cache file. Unable to write to ' . $path);
}
$filename = $this->buildFileName($build);
$success = file_put_contents($path . DIRECTORY_SEPARATOR . $filename, $content) !== false;
$this->finalize($build);
return $success;
}
public function testThemeFileSaving() { $writer = new AssetWriter(['js' => false, 'css' => false], TMP, 'blue'); $writer->write($this->target, 'theme file.'); $contents = file_get_contents(TMP . 'blue-test.js'); $this->assertEquals('theme file.', $contents); unlink(TMP . 'blue-test.js'); }