assertLessThan()
assertLessThan(mixed $expected, mixed $actual[, string $message = ''])
Reports an error identified by $message if the value of $actual is not less than the value of $expected.
assertAttributeLessThan() is a convenience wrapper that uses a public, protected, or private attribute of a class or object as the actual value.
Example A.36: Usage of assertLessThan()
<?php
use PHPUnit\Framework\TestCase;
class LessThanTest extends TestCase
{
public function testFailure()
{
$this->assertLessThan(1, 2);
}
}
?>
phpunit LessThanTest PHPUnit 5.6.0 by Sebastian Bergmann and contributors. F Time: 0 seconds, Memory: 5.00Mb There was 1 failure: 1) LessThanTest::testFailure Failed asserting that 2 is less than 1. /home/sb/LessThanTest.php:6 FAILURES! Tests: 1, Assertions: 1, Failures: 1.
Please login to continue.