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


PHP PHPUnit_Framework_Assert::assertGreaterThanOrEqual方法代码示例

本文整理汇总了PHP中PHPUnit_Framework_Assert::assertGreaterThanOrEqual方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::assertGreaterThanOrEqual方法的具体用法?PHP PHPUnit_Framework_Assert::assertGreaterThanOrEqual怎么用?PHP PHPUnit_Framework_Assert::assertGreaterThanOrEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPUnit_Framework_Assert的用法示例。


在下文中一共展示了PHPUnit_Framework_Assert::assertGreaterThanOrEqual方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: it_can_be_added_to_faker_as_a_provider_and_used

 /** @test */
 public function it_can_be_added_to_faker_as_a_provider_and_used()
 {
     $faker = Factory::create();
     $faker->addProvider(new BuzzwordJobProvider($faker));
     $jobTitle = $faker->jobTitle();
     $jobTitleWords = explode(' ', $jobTitle);
     Assert::assertGreaterThanOrEqual(3, $jobTitleWords);
 }
开发者ID:Brunty,项目名称:faker-buzzword-job-titles,代码行数:9,代码来源:BuzzwordJobProviderTest.php

示例2: toBeGreaterThanOrEqualTo

 public function toBeGreaterThanOrEqualTo($expected)
 {
     if ($this->negate) {
         a::assertLessThan($expected, $this->actual);
     } else {
         a::assertGreaterThanOrEqual($expected, $this->actual);
     }
 }
开发者ID:jasonmccreary,项目名称:expect,代码行数:8,代码来源:Expect.php

示例3: testGenerateHeaders

 public function testGenerateHeaders()
 {
     $generator = new Generator();
     $headers = $generator->addSignatureToHeadersArray('GET', 'http://somesite.com/sample/url', ['foo' => 'bar'], 'myapi123', 'mysecret456');
     $nonce = $headers['X-TOKENLY-AUTH-NONCE'];
     PHPUnit::assertGreaterThanOrEqual(time(), $nonce);
     PHPUnit::assertEquals('myapi123', $headers['X-TOKENLY-AUTH-API-TOKEN']);
     $expected_signature = $this->expectedSignature($nonce);
     PHPUnit::assertEquals($expected_signature, $headers['X-TOKENLY-AUTH-SIGNATURE']);
     // with GET params
     $headers = $generator->addSignatureToHeadersArray('GET', 'http://somesite.com/sample/url?foo=bar', null, 'myapi123', 'mysecret456');
     $nonce = $headers['X-TOKENLY-AUTH-NONCE'];
     PHPUnit::assertGreaterThanOrEqual(time(), $nonce);
     PHPUnit::assertEquals('myapi123', $headers['X-TOKENLY-AUTH-API-TOKEN']);
     $expected_signature = $this->expectedSignature($nonce);
     PHPUnit::assertEquals($expected_signature, $headers['X-TOKENLY-AUTH-SIGNATURE']);
 }
开发者ID:tokenly,项目名称:hmac-auth,代码行数:17,代码来源:GeneratorTest.php

示例4: foreach

 /**
  * @When /^el usuario "([^"]*)" tiene una sanción por la taquilla "([^"]*)" de todo el curso$/
  */
 public function elUsuarioTieneUnaSanciónPorLaTaquillaDeTodoElCurso($username, $code)
 {
     /** @var User $user */
     $user = $this->getRepository('user')->findOneBy(['username' => $username]);
     if (!$user) {
         throw new \Exception('User not found: ' . $username);
     }
     \PHPUnit_Framework_Assert::assertTrue($user->getIsPenalized());
     $this->getEntityManager()->refresh($user);
     $penalties = $user->getPenalties();
     $endSeason = TimePenalty::getEndSeasonPenalty();
     foreach ($penalties as $penalty) {
         if ($penalty instanceof TimePenalty) {
             if ($penalty->getRental()->getLocker()->getCode() == $code) {
                 \PHPUnit_Framework_Assert::assertGreaterThanOrEqual($endSeason, $penalty->getEndAt());
                 return true;
             }
         }
     }
     throw new \Exception('TimePenalty not found.');
 }
开发者ID:aulasoftwarelibre,项目名称:seta,代码行数:24,代码来源:PenaltyContext.php

示例5: testAuthenticationHeaders

 public function testAuthenticationHeaders()
 {
     $generator = new Generator();
     $api = Phake::partialMock('Tokenly\\APIClient\\TokenlyAPI', 'https://127.0.0.1/api/v1', $generator, 'MY_CLIENT_ID', 'MY_CLIENT_SECRET');
     $headers_generated = [];
     Phake::when($api)->callRequest(Phake::anyParameters())->thenReturnCallback(function ($url, $headers, $body, $method, $options) use(&$headers_generated) {
         $response = new Requests_Response();
         $response->body = json_encode(['sample' => 'output']);
         $headers_generated = $headers;
         return $response;
     });
     $result = $api->call('GET', 'method/one', ['foo' => 'bar']);
     PHPUnit::assertEquals(['sample' => 'output'], $result);
     // check headers
     PHPUnit::assertNotEmpty($headers_generated);
     $nonce = $headers_generated['X-TOKENLY-AUTH-NONCE'];
     PHPUnit::assertGreaterThanOrEqual(time(), $nonce);
     PHPUnit::assertEquals('MY_CLIENT_ID', $headers_generated['X-TOKENLY-AUTH-API-TOKEN']);
     $expected_signature = $this->expectedSignature($nonce);
     PHPUnit::assertEquals($expected_signature, $headers_generated['X-TOKENLY-AUTH-SIGNATURE']);
 }
开发者ID:tokenly,项目名称:api-client,代码行数:21,代码来源:AuthenticatedAPITest.php

示例6: iShouldSeeATableContainingTheFollowingRows

 /**
  * @Then /^I should see a table containing the following rows:$/
  */
 public function iShouldSeeATableContainingTheFollowingRows(TableNode $table)
 {
     $output = $this->getOutputAsArray();
     $expectedRows = $table->getRows();
     $foundRows = 0;
     foreach ($expectedRows as $row) {
         foreach ($output as $line) {
             $foundCells = 0;
             foreach ($row as $cell) {
                 if (!$cell) {
                     $foundCells++;
                     continue;
                 }
                 if (false !== strpos($line, $cell)) {
                     $foundCells++;
                 }
             }
             if ($foundCells == count($row)) {
                 $foundRows++;
             }
         }
     }
     \PHPUnit_Framework_Assert::assertGreaterThanOrEqual(count($expectedRows), $foundRows, $this->getOutput());
 }
开发者ID:hason,项目名称:phpcr-shell,代码行数:27,代码来源:ContextBase.php

示例7: testCreatePost

 public function testCreatePost()
 {
     //fwrite(STDOUT, __METHOD__ . "\n");
     PHPUnit_Framework_Assert::assertNotNull(self::$postPDO);
     $newPostItem = array('id' => null, 'forumId' => self::$forumId, 'userId' => SELF::USER_ID, 'title' => 'TestPost.0', 'content' => 'This is a test post item.0', 'contentType' => 'text/plain');
     $forumPostItemId = self::$postPDO->createForumPostEntry($newPostItem);
     PHPUnit_Framework_Assert::assertNotNull($forumPostItemId);
     PHPUnit_Framework_Assert::assertGreaterThanOrEqual(0, $forumPostItemId);
     $newPostItem['id'] = $forumPostItemId;
     return $newPostItem;
 }
开发者ID:szwork2013,项目名称:impulse,代码行数:11,代码来源:ForumPostServicePDOTest.php

示例8: theResponseShouldContainJson

 /**
  * Checks that response body contains JSON from PyString.
  *
  * Do not check that the response body /only/ contains the JSON from PyString,
  *
  * @param PyStringNode $jsonString
  *
  * @throws \RuntimeException
  *
  * @Then /^(?:the )?response should contain json:$/
  */
 public function theResponseShouldContainJson(PyStringNode $jsonString)
 {
     $etalon = json_decode($this->replacePlaceHolder($jsonString->getRaw()), true);
     $actual = json_decode($this->getResponse()->getBody(), true);
     if (null === $etalon) {
         throw new \RuntimeException("Can not convert etalon to json:\n" . $this->replacePlaceHolder($jsonString->getRaw()));
     }
     Assertions::assertGreaterThanOrEqual(count($etalon), count($actual));
     foreach ($etalon as $key => $needle) {
         if (is_array($needle)) {
             foreach ($needle as $k => $v) {
                 if (is_array($v) && in_array('id', array_keys($v))) {
                     continue 2;
                 }
             }
         }
         if (in_array($key, ['id', 'updated_at', 'created_at', 'start_at', 'end_at', 'slug'])) {
             continue;
         }
         Assertions::assertArrayHasKey($key, $actual);
         Assertions::assertEquals($etalon[$key], $actual[$key]);
     }
 }
开发者ID:dafiti,项目名称:WebApiExtension,代码行数:34,代码来源:WebApiContext.php

示例9: theResponseShouldContainJson

 /**
  * Checks that response body contains JSON from PyString.
  *
  * Do not check that the response body /only/ contains the JSON from PyString,
  *
  * @param PyStringNode $jsonString
  *
  * @throws \RuntimeException
  *
  * @Then /^(?:the )?response should contain json:$/
  */
 public function theResponseShouldContainJson(PyStringNode $jsonString)
 {
     $etalon = json_decode($this->replacePlaceHolder($jsonString->getRaw()), true);
     $actual = $this->response->json();
     if (null === $etalon) {
         throw new \RuntimeException("Can not convert etalon to json:\n" . $this->replacePlaceHolder($jsonString->getRaw()));
     }
     Assertions::assertGreaterThanOrEqual(count($etalon), count($actual));
     foreach ($etalon as $key => $needle) {
         Assertions::assertArrayHasKey($key, $actual);
         Assertions::assertEquals($etalon[$key], $actual[$key]);
     }
 }
开发者ID:pavelsmolka,项目名称:WebApiExtension,代码行数:24,代码来源:WebApiContext.php

示例10: greaterOrEquals

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

示例11: assertGreaterOrEquals

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

示例12: theResultContainsAtLeastItems

 /**
  * @Then the api/API result should contain at least :count item(s)
  * @Then the api/API result contains at least :count item(s)
  */
 public function theResultContainsAtLeastItems($count)
 {
     $result = $this->getApiResult();
     Assert::assertContainsOnly('array', $result);
     Assert::assertGreaterThanOrEqual($count, count($result));
 }
开发者ID:treehouselabs,项目名称:base-api-bundle,代码行数:10,代码来源:ApiContext.php

示例13: isGreaterOrEqualTo

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

示例14: theResponseShouldContainJson

 /**
  * @Then the response should contain json:
  */
 public function theResponseShouldContainJson(PyStringNode $jsonString)
 {
     $etalon = json_decode($jsonString->getRaw(), true);
     $a = $this->getSession()->getPage();
     //        $b = $this->getSession()->getPage()->getHtml();
     $c = $this->getSession()->getPage()->getContent();
     $actual = json_decode($this->getMink()->getSession()->getPage()->getContent(), true);
     if (null === $etalon) {
         throw new \RuntimeException("Can not convert etalon to json:\n");
     }
     Assertions::assertGreaterThanOrEqual(count($etalon), count($actual));
     foreach ($etalon as $key => $needle) {
         Assertions::assertArrayHasKey($key, $actual);
         $e = $etalon[$key];
         $g = $actual[$key];
         Assertions::assertEquals($etalon[$key], $actual[$key]);
     }
 }
开发者ID:ReissClothing,项目名称:BackBee,代码行数:21,代码来源:WebApiContext.php

示例15: theResponseShouldContainJson

 /**
  * Checks that response body contains JSON from PyString.
  *
  * Do not check that the response body /only/ contains the JSON from PyString,
  *
  * @param PyStringNode $jsonString
  *
  * @throws \RuntimeException
  *
  * @Then /^(?:the )?response should contain json:$/
  */
 public function theResponseShouldContainJson(PyStringNode $jsonString)
 {
     $expected = json_decode($this->replacePlaceHolder($jsonString->getRaw()), true);
     $actual = json_decode($this->response->getBody(), true);
     if (null === $expected) {
         throw new \RuntimeException("Can not convert expected to json:\n" . $this->replacePlaceHolder($jsonString->getRaw()));
     }
     Assertions::assertGreaterThanOrEqual(count($expected), count($actual));
     $this->assertContains($expected, $actual);
 }
开发者ID:code-community,项目名称:behat-web-api-extension,代码行数:21,代码来源:WebApiContext.php


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