Пример #1
0
 private function test_ok($condition, $message, $error = null)
 {
     list($file, $line) = LimeTrace::findCaller('LimeTest');
     if ($result = (bool) $condition) {
         $this->output->pass($message, $file, $line);
     } else {
         $this->output->fail($message, $file, $line, $error);
     }
     return $result;
 }
Пример #2
0
 public function expect($exception, $code = null)
 {
     list($file, $line) = LimeTrace::findCaller('LimeTest');
     $this->exceptionExpectation = new LimeExceptionExpectation($exception, $file, $line);
     $this->exception = null;
 }
 /**
  * Verifies whether the requirements of all configured modifiers have been
  * fulfilled.
  *
  * Depending on the result, either a failed or a passed test is written to the
  * output. A method may only be verified once.
  *
  * Note: Methods are verified automatically once invoke() is called and
  * all matchers are satisfied. In this case verify() simply does nothing.
  */
 public function verify()
 {
     if (!$this->verified) {
         list($file, $line) = LimeTrace::findCaller('LimeMockInterface');
         if ($this->isSatisfied()) {
             $this->output->pass((string) $this, $file, $line);
         } else {
             $this->output->fail((string) $this, $file, $line);
         }
         $this->verified = true;
     }
 }