assertNotFalse() public static méthode

Asserts that a condition is not false.
public static assertNotFalse ( boolean $condition, string $message = '' )
$condition boolean
$message string
Exemple #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.');
     }
 }
 public function isNotFalse()
 {
     Assert::assertNotFalse($this->actual, $this->description);
     return $this;
 }
Exemple #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;
 }
 /**
  * @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);
     }
 }