isFalse() public method

public isFalse ( $failMessage = null )
Example #1
0
 public function testIsFalse()
 {
     $this->if($asserter = new sut($generator = new asserter\generator()))->then->exception(function () use($asserter) {
         $asserter->isFalse();
     })->isInstanceOf('logicException')->hasMessage('Value is undefined')->if($asserter->setWith(false))->then->object($asserter->isFalse())->isIdenticalTo($asserter)->if($asserter->setWith(true))->and($diff = new diffs\variable())->then->exception(function () use($asserter) {
         $asserter->isFalse();
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('%s is not false'), $asserter) . PHP_EOL . $diff->setExpected(false)->setActual(true))->if($asserter->setWith(false))->then->object($asserter->isFalse)->isIdenticalTo($asserter)->if($asserter->setWith(true))->and($diff = new diffs\variable())->then->exception(function () use($asserter) {
         $asserter->isFalse;
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('%s is not false'), $asserter) . PHP_EOL . $diff->setExpected(false)->setActual(true));
 }
Example #2
0
 protected function matches($actual)
 {
     if ($this->analyzer->isBoolean($this->expected) === false) {
         throw new \PHPUnit_Framework_Exception('Expected value of ' . __CLASS__ . ' must be a boolean');
     }
     $asserter = new asserters\boolean(null, $this->analyzer);
     $asserter->setWith($actual);
     if ($this->expected) {
         $asserter->isTrue();
     } else {
         $asserter->isFalse();
     }
 }