/**
  * @covers tad_Arg_Check::fail
  * @covers tad_Arg_Check_FailingState::fail
  * @uses   tad_Arg_Check::is_failed
  */
 public function testCanFail()
 {
     $this->tad_arg_check->fail();
     $this->assertTrue($this->tad_arg_check->is_failed());
 }
Exemple #2
0
 /**
  * @param $condition
  * @param $reason
  *
  * @return $this
  */
 public function assert($condition, $reason)
 {
     if ($this->check->is_failed()) {
         $this->throw_exception($reason);
     }
     if (!$condition) {
         $this->check->fail();
         $this->reason = $reason;
     } else {
         $this->check->pass();
     }
     return $this;
 }