assertLessThan() public static method

Asserts that a value is smaller than another value.
public static assertLessThan ( mixed $expected, mixed $actual, string $message = '' )
$expected mixed
$actual mixed
$message string
Ejemplo n.º 1
0
 public function optimizedFileIsSmallerThanPercent($percent)
 {
     $originalFilesize = filesize($this->originalImage);
     $actualPercent = filesize($this->optimizedImage) / $originalFilesize * 100;
     \PHPUnit_Framework_Assert::assertLessThan($percent, $actualPercent, 'compression level is too small');
     return $this;
 }
Ejemplo n.º 2
0
 public function toBeGreaterThanOrEqualTo($expected)
 {
     if ($this->negate) {
         a::assertLessThan($expected, $this->actual);
     } else {
         a::assertGreaterThanOrEqual($expected, $this->actual);
     }
 }
Ejemplo n.º 3
0
/**
 * Asserts that a value is smaller than another value.
 *
 * @param  mixed   $expected
 * @param  mixed   $actual
 * @param  string  $message
 * @since  Method available since Release 3.1.0
 */
function assertLessThan($expected, $actual, $message = '')
{
    return PHPUnit_Framework_Assert::assertLessThan($expected, $actual, $message);
}
 /**
  * Checks if collection doesn't contain an item.
  *
  * ``` php
  * <?php
  * $I->dontSeeInDatabaseCollection('database', 'users', array('name' => 'miles'));
  * ```
  *
  * @param       $database
  * @param       $collection
  * @param array $criteria
  */
 public function dontSeeInDatabaseCollection($database, $collection, $criteria = array())
 {
     $this->checkDatabase($database);
     $collection = $this->drivers[$database]->getDbh()->selectCollection($collection);
     $res = $collection->count($criteria);
     \PHPUnit_Framework_Assert::assertLessThan(1, $res);
 }
Ejemplo n.º 5
0
 /**
  * Checks if collection doesn't contain an item.
  *
  * ``` php
  * <?php
  * $I->dontSeeInCollection('users', array('name' => 'miles'));
  * ```
  *
  * @param $collection
  * @param array $criteria
  */
 public function dontSeeInCollection($collection, $criteria = array())
 {
     $collection = $this->driver->getDbh()->selectCollection($collection);
     $res = $collection->count($criteria);
     \PHPUnit_Framework_Assert::assertLessThan(1, $res);
 }
Ejemplo n.º 6
0
 public function dontSeeInDatabase($table, $criteria = [])
 {
     $res = $this->proceedSeeInDatabase($table, "count(*)", $criteria);
     \PHPUnit_Framework_Assert::assertLessThan(1, $res);
 }
Ejemplo n.º 7
0
 public function lessThan($expected)
 {
     a::assertLessThan($expected, $this->actual, $this->description);
 }
Ejemplo n.º 8
0
 /**
  * Expect that a value is smaller than another value.
  *
  * @param mixed $expected
  * @param string $message
  *
  * @return Expect
  */
 public function toBeLessThan($expected, $message = '')
 {
     Assert::assertLessThan($expected, $this->value, $message);
     return $this;
 }
Ejemplo n.º 9
0
 public function toBeLessThan($expected)
 {
     \PHPUnit_Framework_Assert::assertLessThan($expected, $this->actual);
 }
Ejemplo n.º 10
0
 public function isLessThan($expected)
 {
     Assert::assertLessThan($expected, $this->actual, $this->description);
     return $this;
 }
Ejemplo n.º 11
0
 /**
  * @When /^el alquiler de la taquilla "([^"]*)" ha caducado$/
  */
 public function elAlquilerDeLaTaquillaHaCaducado($code)
 {
     /** @var Locker $locker */
     $locker = $this->getRepository('locker')->findOneBy(['code' => $code]);
     if (!$locker) {
         throw new \Exception('Locker not found: ' . $code);
     }
     /** @var Rental $rental */
     $rental = $this->getRepository('rental')->getCurrentRental($locker);
     $now = new \DateTime('now');
     \PHPUnit_Framework_Assert::assertLessThan($now, $rental->getEndAt());
 }
 /**
  * @Then response :field is less than :value
  */
 public function responseFieldValueIsLessThan($field, $value)
 {
     Assert::assertLessThan($value, $this->getResponseField($field));
 }