3 class PHPT_Section_PRESKIPIF
implements PHPT_Section_RunnableBefore
6 private $_runner_factory = null;
8 public function __construct($data)
11 $this->_runner_factory
= new PHPT_CodeRunner_Factory();
14 public function run(PHPT_Case
$case)
16 // @todo refactor this code into PHPT_Util class as its used in multiple places
17 $filename = dirname($case->filename
) . '/' . basename($case->filename
, '.php') . '.skip.php';
19 // @todo refactor to PHPT_CodeRunner
20 file_put_contents($filename, $this->_data
);
21 $runner = $this->_runner_factory
->factory($case);
23 $response = $runner->run($filename)->output
;
26 if (preg_match('/^skip( - (.*))?/', $response, $matches)) {
27 $message = !empty($matches[2]) ?
$matches[2] : '';
28 throw new PHPT_Case_VetoException($message);
32 public function getPriority()