assertNotFalse() public static method

Asserts that a condition is not false.
public static assertNotFalse ( boolean $condition, string $message = '' )
$condition boolean
$message string
Example #1
0
 public function toBeFalse()
 {
     if ($this->negate) {
         a::assertNotFalse($this->actual);
     } else {
         a::assertFalse($this->actual);
     }
 }
 /**
  * Check if one array has the values of other array.
  *
  * Used to compare unsorted single dimension arrays.
  *
  * @param array $needle              Subset.
  * @param array $haystack            Set.
  * @param bool  $shouldFitCompletely Set should only contain specified values.
  */
 protected function assertArrayContainsArrayValues($needle, $haystack, $shouldFitCompletely = false)
 {
     foreach ($needle as $val) {
         $key = array_search($val, $haystack);
         \PHPUnit_Framework_Assert::assertNotFalse($key, "Failed asserting that array contains {$val}.");
         unset($haystack[$key]);
     }
     if ($shouldFitCompletely) {
         \PHPUnit_Framework_Assert::assertTrue(empty($haystack), 'Failed asserting that array contains all values.');
     }
 }
Example #3
0
 public function isNotFalse()
 {
     Assert::assertNotFalse($this->actual, $this->description);
     return $this;
 }
Example #4
0
 /**
  * Expect that a condition is not false.
  *
  * @param string $message
  *
  * @return Expect
  */
 public function notToBeFalse($message = '')
 {
     Assert::assertNotFalse($this->value, $message);
     return $this;
 }
Example #5
0
 /**
  * @param PyStringNode $content
  *
  * @Then Crontab should be:
  *
  * @SuppressWarnings(PHPMD.StaticAccess)
  */
 public function crontabShouldBe(PyStringNode $content)
 {
     $crontab = $this->currentCrontab;
     Assertions::assertNotFalse($crontab);
     if ("" == $content->getRaw()) {
         Assertions::assertEquals("", $crontab);
     } else {
         Assertions::assertEquals($content->getRaw(), $crontab);
     }
 }