standardize EOLs to output diffs properly on Windows
[phpt.git] / src / PHPT / Case / Validator / Runnable.php
blobcf775eb39480b6efc306a433271cade1dd0b81d8
1 <?php
3 class PHPT_Case_Validator_Runnable implements PHPT_Case_Validator
5 private $_message = false;
7 public function __construct()
12 public function validate(PHPT_Case $case)
14 if (!$this->is($case)) {
15 throw new PHPT_Case_InvalidCaseException($this->_message);
19 public function is(PHPT_Case $case)
21 if ($case->sections->has('FILE') == false) {
22 $this->_message = 'missing FILE section';
23 } elseif ($case->sections->has('TEST') == false) {
24 $this->_message = 'missing TEST section';
27 return !(bool)$this->_message;