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; }
public function toBeGreaterThanOrEqualTo($expected) { if ($this->negate) { a::assertLessThan($expected, $this->actual); } else { a::assertGreaterThanOrEqual($expected, $this->actual); } }
/** * 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); }
/** * 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); }
public function dontSeeInDatabase($table, $criteria = []) { $res = $this->proceedSeeInDatabase($table, "count(*)", $criteria); \PHPUnit_Framework_Assert::assertLessThan(1, $res); }
public function lessThan($expected) { a::assertLessThan($expected, $this->actual, $this->description); }
/** * 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; }
public function toBeLessThan($expected) { \PHPUnit_Framework_Assert::assertLessThan($expected, $this->actual); }
public function isLessThan($expected) { Assert::assertLessThan($expected, $this->actual, $this->description); return $this; }
/** * @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)); }