add @todo note
[phpt.git] / src / PHPT / Section / CLEAN.php
blob51addc4dc2f7c31d0478fe2a03bc5d2b87d9d169
1 <?php
3 class PHPT_Section_CLEAN implements PHPT_Section_RunnableAfter
5 public $filename = null;
6 public $output = '';
7 private $_data = null;
9 public function __construct($data)
11 $this->_data = $data;
14 public function __destruct()
16 @unlink($this->filename);
19 // @todo add test to make sure Clean::run() actually executes code
20 public function run(PHPT_Case $case)
22 $this->filename = substr($case->filename, 0, -4) . '.clean.php';
23 file_put_contents($this->filename, $this->_data);
25 // @todo refactor into a PHPT_CodeRunner_Factory::forClean()
26 $runner = new PHPT_CodeRunner();
27 $result = $runner->run($this->filename);
28 $this->output = $result->output;
31 public function getPriority()