Exemple #1
0
 public function make()
 {
     if ($this->reference === null) {
         throw new exceptions\runtime('Reference is undefined');
     }
     if ($this->data === null) {
         throw new exceptions\runtime('Data is undefined');
     }
     return parent::make();
 }
Exemple #2
0
 public function make()
 {
     if ($this->expected === null) {
         throw new exceptions\runtime('Expected is undefined');
     }
     if ($this->actual === null) {
         throw new exceptions\runtime('Actual is undefined');
     }
     return parent::make();
 }
Exemple #3
0
 public function make($expected = null, $actual = null)
 {
     if ($expected !== null) {
         $this->setExpected($expected);
     }
     if ($expected !== null) {
         $this->setActual($actual);
     }
     if ($this->expected === null) {
         throw new exceptions\runtime('Expected is undefined');
     }
     if ($this->actual === null) {
         throw new exceptions\runtime('Actual is undefined');
     }
     return parent::make();
 }
Exemple #4
0
 public function testMake()
 {
     $diff = new tools\diff();
     $this->assert->array($diff->make())->isEqualTo(array(''))->array($diff->setActual($data = rand(0, 9))->make())->isEqualTo(array(array('-' => array(''), '+' => array($data))))->array($diff->setActual($data = uniqid())->make())->isEqualTo(array(array('-' => array(''), '+' => array($data))))->array($diff->setExpected($data)->make())->isEqualTo(array($data))->array($diff->setExpected('')->setActual(($firstLine = uniqid()) . PHP_EOL . ($secondLine = uniqid()))->make())->isEqualTo(array(array('-' => array(''), '+' => array($firstLine, $secondLine))));
 }