当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPUnit_Framework_Assert::assertLessThanOrEqual方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:jasonmccreary,项目名称:expect,代码行数:8,代码来源:Expect.php

示例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;
 }
开发者ID:zhangxiaoliu,项目名称:PHPPdf,代码行数:10,代码来源:AbstractGraphicsContextTest.php

示例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);
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:12,代码来源:Functions.php

示例4: lessOrEquals

 public function lessOrEquals($expected)
 {
     a::assertLessThanOrEqual($expected, $this->actual, $this->description);
 }
开发者ID:jaschweder,项目名称:Verify,代码行数:4,代码来源:Verify.php

示例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));
 }
开发者ID:EllynB,项目名称:Incipio,代码行数:12,代码来源:JsonContext.php

示例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;
 }
开发者ID:jpkleemans,项目名称:phpunit-expect,代码行数:13,代码来源:Expect.php

示例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;
 }
开发者ID:SystemEd-Jacob,项目名称:nethgui,代码行数:19,代码来源:EsmithDatabaseTest.php

示例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);
 }
开发者ID:kieljohn,项目名称:TenantBundle,代码行数:9,代码来源:CommandContext.php

示例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());
 }
开发者ID:treehouselabs,项目名称:behat-common,代码行数:12,代码来源:SwiftmailerContext.php

示例10: assertLessOrEquals

 /**
  * @param $expected
  * @param $actual
  * @param $description
  */
 protected function assertLessOrEquals($expected, $actual, $description)
 {
     \PHPUnit_Framework_Assert::assertLessThanOrEqual($expected, $actual, $description);
 }
开发者ID:janhenkgerritsen,项目名称:Codeception,代码行数:9,代码来源:Asserts.php

示例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());
 }
开发者ID:eBayEnterprise,项目名称:magento2-retail-order-management,代码行数:8,代码来源:IntegrationContext.php

示例12: isLessOrEqualTo

 public function isLessOrEqualTo($expected)
 {
     Assert::assertLessThanOrEqual($expected, $this->actual, $this->description);
     return $this;
 }
开发者ID:dekeysoft,项目名称:pu-tester,代码行数:5,代码来源:ValueMatcher.php


注:本文中的PHPUnit_Framework_Assert::assertLessThanOrEqual方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。