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


PHP PHPUnit_Framework_Assert::fail方法代码示例

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


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

示例1: deleteFile

 /**
  * Deletes a file
  *
  * ``` php
  * <?php
  * $I->deleteFile('composer.lock');
  * ?>
  * ```
  *
  * @param $filename
  */
 public function deleteFile($filename)
 {
     if (!file_exists($this->absolutizePath($filename))) {
         \PHPUnit_Framework_Assert::fail('file not found');
     }
     unlink($this->absolutizePath($filename));
 }
开发者ID:yurireeis,项目名称:CodeCeptionTest,代码行数:18,代码来源:Filesystem.php

示例2: getMessagesCurrentCountOnQueue

 /**
  * Count the current number of messages on the queue.
  *
  * @param $queue Queue Name
  *
  * @return int Count
  */
 public function getMessagesCurrentCountOnQueue($queue)
 {
     try {
         return $this->queue->statsTube($queue)['current-jobs-ready'];
     } catch (\Pheanstalk_Exception_ServerException $e) {
         \PHPUnit_Framework_Assert::fail("queue [{$queue}] not found");
     }
 }
开发者ID:itillawarra,项目名称:cmfive,代码行数:15,代码来源:Beanstalk.php

示例3: _testCreate

 protected function _testCreate()
 {
     if ($this->_model->getId()) {
         \PHPUnit_Framework_Assert::fail("Can't run creation test for models with defined id");
     }
     $this->_model->save();
     \PHPUnit_Framework_Assert::assertNotEmpty($this->_model->getId(), 'CRUD Create error');
 }
开发者ID:tingyeeh,项目名称:magento2,代码行数:8,代码来源:Entity.php

示例4: clearQueue

 public function clearQueue($queue)
 {
     try {
         $this->queue->clearQueue($queue);
     } catch (\Http_Exception $ex) {
         \PHPUnit_Framework_Assert::fail("queue [{$queue}] not found");
     }
 }
开发者ID:itillawarra,项目名称:cmfive,代码行数:8,代码来源:Iron.php

示例5: responseStatusCodeIs

 /**
  * @Then response status code is :code
  *
  * @param int $code
  */
 public function responseStatusCodeIs($code)
 {
     if (!$this->api->getClient()->getLastResponse()) {
         PHPUnit_Framework_Assert::fail();
     }
     $statusCode = $this->api->getClient()->getLastResponse()->getStatusCode();
     PHPUnit_Framework_Assert::assertEquals($code, $statusCode);
 }
开发者ID:Rud5G,项目名称:jira-api,代码行数:13,代码来源:FeatureContext.php

示例6: seeElement

 /**
  * Checks element visibility.
  * Fails if element exists but is invisible to user.
  *
  * @param $css
  */
 public function seeElement($css)
 {
     $el = $this->session->getPage()->find('css', $css);
     if (!$el) {
         \PHPUnit_Framework_Assert::fail("Element {$css} not found");
     }
     \PHPUnit_Framework_Assert::assertTrue($this->session->getDriver()->isVisible($el->getXpath()));
 }
开发者ID:BatVane,项目名称:Codeception,代码行数:14,代码来源:MinkJS.php

示例7: invoke

 /**
  * @param PHPUnit_Framework_MockObject_Invocation $invocation
  * @return the invocation of the Entry with matching parameters.
  */
 public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation)
 {
     foreach ($this->return_map as $entry) {
         if ($entry->matches($invocation)) {
             return $entry->invoke($invocation);
         }
     }
     PHPUnit_Framework_Assert::fail(sprintf('No return value defined for %s', PHPUnit_Util_Type::toString($invocation->parameters)));
 }
开发者ID:nidalhajaj,项目名称:tubepress,代码行数:13,代码来源:ReturnMapping.php

示例8: getIterator

 /**
  * @return Generator
  */
 public function getIterator()
 {
     foreach ($this->stack as $index => $resource) {
         if (!is_object($resource)) {
             PHPUnit::fail(sprintf('Encountered a resource that is not an object at index %d', $index));
         }
         (yield $index => new ResourceTester($resource, $index));
     }
 }
开发者ID:cloudcreativity,项目名称:json-api,代码行数:12,代码来源:ResourcesTester.php

示例9: thereIsAContentTypeWithId

 /**
  * @Given /^there is a Content Type "([^"]*)" with the id "([^"]*)"$/
  */
 public function thereIsAContentTypeWithId($contentTypeIdentifier, $id)
 {
     try {
         $contentType = $this->contentTypeService->loadContentTypeByIdentifier($contentTypeIdentifier);
         Assertion::assertEquals($id, $contentType->id);
     } catch (NotFoundException $e) {
         Assertion::fail("No ContentType with the identifier '{$contentTypeIdentifier}' could be found.");
     }
 }
开发者ID:ezsystems,项目名称:repository-forms,代码行数:12,代码来源:ContentType.php

示例10: getIterator

 /**
  * @return Generator
  */
 public function getIterator()
 {
     foreach ($this->errors as $index => $error) {
         if (!is_object($error)) {
             PHPUnit::fail(sprintf('Encountered an error that is not an object at index %d', $index));
         }
         (yield $index => new ErrorTester($error));
     }
 }
开发者ID:cloudcreativity,项目名称:json-api,代码行数:12,代码来源:ErrorsTester.php

示例11: runTest

 /**
  * @access public
  */
 protected function runTest()
 {
     $timer = new Benchmark_Timer();
     $timer->start();
     parent::runTest();
     $timer->stop();
     if ($this->fMaxRunningTime != 0 && $timer->timeElapsed() > $this->fMaxRunningTime) {
         PHPUnit_Framework_Assert::fail(sprintf('expected running time: <= %s but was: %s', $this->fMaxRunningTime, $timer->timeElapsed()));
     }
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:13,代码来源:PerformanceTestCase.php

示例12: apc_store

function apc_store($key, $value)
{
    if (count($GLOBALS['expected_apc_store_calls']) == 0) {
        \PHPUnit_Framework_Assert::fail("Unexpected apc_store({$key}, {$value})");
    }
    $call = array_shift($GLOBALS['expected_apc_store_calls']);
    \PHPUnit_Framework_Assert::assertEquals($call['args'][0], $key);
    \PHPUnit_Framework_Assert::assertEquals($call['args'][1], $value);
    return $call['ret'];
}
开发者ID:bitcpf,项目名称:djangoage,代码行数:10,代码来源:CloudStorageToolsTest.php

示例13: create

 /**
  * Create a document tester from a raw HTTP response content.
  *
  * @param string $responseContent
  * @return DocumentTester
  */
 public static function create($responseContent)
 {
     $decoded = json_decode($responseContent);
     if (JSON_ERROR_NONE !== json_last_error()) {
         PHPUnit::fail('Invalid response JSON: ' . json_last_error_msg());
     }
     if (!is_object($decoded)) {
         PHPUnit::fail('Invalid JSON API response content.');
     }
     return new self($decoded);
 }
开发者ID:cloudcreativity,项目名称:json-api,代码行数:17,代码来源:DocumentTester.php

示例14: usingServer

 /**
  * @Given /^Using server "([^"]*)"$/
  */
 public function usingServer($server)
 {
     if ($server === 'LOCAL') {
         $this->baseUrl = $this->localBaseUrl;
         $this->currentServer = 'LOCAL';
     } elseif ($server === 'REMOTE') {
         $this->baseUrl = $this->remoteBaseUrl;
         $this->currentServer = 'REMOTE';
     } else {
         PHPUnit_Framework_Assert::fail("Server can only be LOCAL or REMOTE");
     }
 }
开发者ID:kebenxiaoming,项目名称:core,代码行数:15,代码来源:BasicStructure.php

示例15: invoke

 /**
  * @param PHPUnit_Framework_MockObject_Invocation $invocation
  * @return the invocation of the Entry with matching parameters.
  */
 public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation)
 {
     foreach ($this->return_map as $entry) {
         if ($entry->matches($invocation)) {
             return $entry->invoke($invocation);
         }
     }
     if ($this->default != NULL) {
         return $this->default->invoke($invocation);
     }
     PHPUnit_Framework_Assert::fail(sprintf('No return value defined for %s', $this->exporter->export($invocation->parameters)));
 }
开发者ID:TheOnlyMerlin,项目名称:phpunit-extensions,代码行数:16,代码来源:ReturnMapping.php


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