assertFalse()
1 | assertFalse(bool $condition [, string $message = '' ]) |
Reports an error identified by $message
if $condition
is true
.
assertNotFalse()
is the inverse of this assertion and takes the same arguments.
Example A.21: Usage of assertFalse()
1 2 3 4 5 6 7 8 9 10 11 | <?php use PHPUnit\Framework\TestCase; class FalseTest extends TestCase { public function testFailure() { $this ->assertFalse(true); } } ?> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | phpunit FalseTest PHPUnit 5.6.0 by Sebastian Bergmann and contributors. F Time: 0 seconds, Memory: 5.00Mb There was 1 failure: 1) FalseTest::testFailure Failed asserting that true is false. /home/sb/FalseTest.php:6 FAILURES! Tests: 1, Assertions: 1, Failures: 1. |
Please login to continue.