public function setUp() {
$this->tmpDir = sys_get_temp_dir() . '/TwigTests';
if (!file_exists($this->tmpDir)) {
@mkdir($this->tmpDir, 0777, true);
}
if (!is_writable($this->tmpDir)) {
$this
->markTestSkipped(sprintf('Unable to run the tests as "%s" is not writable.', $this->tmpDir));
}
$this->env = new Twig_Environment(new Twig_Loader_String(), array(
'cache' => $this->tmpDir,
));
}