本文整理汇总了PHP中PHPUnit_Framework_Assert::assertLessThan方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::assertLessThan方法的具体用法?PHP PHPUnit_Framework_Assert::assertLessThan怎么用?PHP PHPUnit_Framework_Assert::assertLessThan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Assert
的用法示例。
在下文中一共展示了PHPUnit_Framework_Assert::assertLessThan方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: optimizedFileIsSmallerThanPercent
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;
}
示例2: toBeGreaterThanOrEqualTo
public function toBeGreaterThanOrEqualTo($expected)
{
if ($this->negate) {
a::assertLessThan($expected, $this->actual);
} else {
a::assertGreaterThanOrEqual($expected, $this->actual);
}
}
示例3: assertLessThan
/**
* 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);
}
示例4: dontSeeInDatabaseCollection
/**
* 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);
}
示例5: dontSeeInCollection
/**
* 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);
}
示例6: dontSeeInDatabase
public function dontSeeInDatabase($table, $criteria = [])
{
$res = $this->proceedSeeInDatabase($table, "count(*)", $criteria);
\PHPUnit_Framework_Assert::assertLessThan(1, $res);
}
示例7: lessThan
public function lessThan($expected)
{
a::assertLessThan($expected, $this->actual, $this->description);
}
示例8: toBeLessThan
/**
* 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;
}
示例9: toBeLessThan
public function toBeLessThan($expected)
{
\PHPUnit_Framework_Assert::assertLessThan($expected, $this->actual);
}
示例10: isLessThan
public function isLessThan($expected)
{
Assert::assertLessThan($expected, $this->actual, $this->description);
return $this;
}
示例11: elAlquilerDeLaTaquillaHaCaducado
/**
* @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());
}
示例12: responseFieldValueIsLessThan
/**
* @Then response :field is less than :value
*/
public function responseFieldValueIsLessThan($field, $value)
{
Assert::assertLessThan($value, $this->getResponseField($field));
}