本文整理汇总了PHP中PHPUnit_Framework_Assert::assertLessThanOrEqual方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::assertLessThanOrEqual方法的具体用法?PHP PHPUnit_Framework_Assert::assertLessThanOrEqual怎么用?PHP PHPUnit_Framework_Assert::assertLessThanOrEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Assert
的用法示例。
在下文中一共展示了PHPUnit_Framework_Assert::assertLessThanOrEqual方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toBeLessThanOrEqualTo
public function toBeLessThanOrEqualTo($expected)
{
if ($this->negate) {
a::assertGreaterThan($expected, $this->actual);
} else {
a::assertLessThanOrEqual($expected, $this->actual);
}
}
示例2: colorAt
public function colorAt($x, $y, $expectedColor)
{
$actualColor = (string) $this->image->getColorAt(new Point($x, $y));
$actualRgb = $this->rgb($actualColor);
$expectedRgb = $this->rgb($expectedColor);
for ($i = 0; $i < 3; $i++) {
\PHPUnit_Framework_Assert::assertLessThanOrEqual(255 * 0.03, abs($actualRgb[$i] - $expectedRgb[$i]), 'expected color: ' . $expectedColor . ', but given: ' . $actualColor);
}
return $this;
}
示例3: assertLessThanOrEqual
/**
* Asserts that a value is smaller than or equal to another value.
*
* @param mixed $expected
* @param mixed $actual
* @param string $message
* @since Method available since Release 3.1.0
*/
function assertLessThanOrEqual($expected, $actual, $message = '')
{
return PHPUnit_Framework_Assert::assertLessThanOrEqual($expected, $actual, $message);
}
示例4: lessOrEquals
public function lessOrEquals($expected)
{
a::assertLessThanOrEqual($expected, $this->actual, $this->description);
}
示例5: theJsonNodeShouldBeLower
/**
* @Then the JSON node :node should be less than :value
*
* @param string $node
* @param string $value
*/
public function theJsonNodeShouldBeLower($node, $value)
{
$json = $this->getJson();
$actual = $this->inspector->evaluate($json, $node);
PHPUnit::assertLessThanOrEqual($value, $actual, sprintf('Expected `%s` to be less than `%s`.', $value, $actual));
}
示例6: toBeLessThanOrEqualTo
/**
* Expect that a value is smaller than or equal to another value.
*
* @param mixed $expected
* @param string $message
*
* @return Expect
*/
public function toBeLessThanOrEqualTo($expected, $message = '')
{
Assert::assertLessThanOrEqual($expected, $this->value, $message);
return $this;
}
示例7: fread
public function fread($socket, $len)
{
\PHPUnit_Framework_Assert::assertEquals($this->socketPath, $socket);
if ($this->readBuffer === NULL) {
assert(is_callable($this->execImplementation));
$retval = NULL;
$output = NULL;
call_user_func_array($this->execImplementation, array("fread", &$output, &$retval));
if (!is_array($output)) {
return FALSE;
}
$data = implode("\n", $output);
$this->readBuffer = pack("CN", (int) 0x11, (int) strlen($data)) . $data;
}
\PHPUnit_Framework_Assert::assertLessThanOrEqual(strlen($this->readBuffer), $len);
$chunk = substr($this->readBuffer, 0, $len);
$this->readBuffer = substr($this->readBuffer, $len);
return $chunk;
}
示例8: allProcessShouldHaveExited
/**
* @Then all process should have exited
*/
public function allProcessShouldHaveExited()
{
$count = trim(shell_exec("ps aux | grep -c '{$this->actualCommand}'"));
// We expect atleast 2 matches, one from grep itself and its parent shell
PHPUnit_Framework_Assert::assertLessThanOrEqual(2, $count);
}
示例9: theEmailBodyShouldContainApproximatelyNumElements
/**
* @Then the email body should contain approximately :number :element elements
* @Then the email body should contain ~ :number :element elements
*/
public function theEmailBodyShouldContainApproximatelyNumElements($num, $element)
{
$num = intval($num);
$crawler = new Crawler($this->message->getBody());
$found = $crawler->filter($element);
Assert::assertGreaterThanOrEqual($num - 1, $found->count());
Assert::assertLessThanOrEqual($num + 1, $found->count());
}
示例10: assertLessOrEquals
/**
* @param $expected
* @param $actual
* @param $description
*/
protected function assertLessOrEquals($expected, $actual, $description)
{
\PHPUnit_Framework_Assert::assertLessThanOrEqual($expected, $actual, $description);
}
示例11: iShouldHaveTheMaximumNumberOfAvailableSuggestions
/**
* @Then I should have the maximum number of available suggestions
*/
public function iShouldHaveTheMaximumNumberOfAvailableSuggestions()
{
$results = $this->getResultForAddress($this->customerAddress);
Assert::assertLessThanOrEqual($this->maxSuggestions, $results->getSuggestionCount());
}
示例12: isLessOrEqualTo
public function isLessOrEqualTo($expected)
{
Assert::assertLessThanOrEqual($expected, $this->actual, $this->description);
return $this;
}