standardize EOLs to output diffs properly on Windows
[phpt.git] / src / PHPT / Section / RETURNS.php
blobe30798fd43ca9fe5b7cfbfe8b7a48aeb6303d360
1 <?php
3 class PHPT_Section_RETURNS implements PHPT_Section_RunnableAfter
5 public function __construct($data = null)
7 $this->_expected = $data;
10 public function run(PHPT_Case $case)
12 if ($case->result->exitcode != $this->_expected) {
13 throw new PHPT_Section_RETURNS_ExitCodeMismatch($case, $this->_expected, $case->result->exitcode);
17 public function getPriority()
23 class PHPT_Section_RETURNS_ExitCodeMismatch extends PHPT_Case_FailureException
25 private $_actual = null;
26 private $_expected = null;
28 public function __construct(PHPT_Case $case, $expected, $actual)
30 parent::__construct($case, 'exit code mismatch');
31 $this->_expected = $expected;
32 $this->_actual = $actual;
35 public function getReason()
37 return "expected {$this->_expected}, received {$this->_actual}";