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


PHP PHPUnit_Framework_TestCase::assertFalse方法代码示例

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


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

示例1: notContainsValue

 /**
  * @test
  */
 public function notContainsValue()
 {
     $collection = $this->getCollectionInstance(['fuu', 'bar']);
     parent::assertFalse($collection->contains('baz'));
     parent::setExpectedException(KeyIsNotDefinedException::class);
     $collection->get('baz');
 }
开发者ID:oqq,项目名称:minc-common,代码行数:10,代码来源:AbstractCollectionTestCase.php

示例2: assert

 public function assert()
 {
     $title = $this->webDriver->getTitle();
     \PHPUnit_Framework_TestCase::assertNotNull($title);
     \PHPUnit_Framework_TestCase::assertNotNull($this->title);
     $title = trim($title);
     $pos = strpos($title, $this->title);
     \PHPUnit_Framework_TestCase::assertFalse($pos);
 }
开发者ID:kschroeder,项目名称:Magium,代码行数:9,代码来源:TitleNotContains.php

示例3: test

 public function test()
 {
     $routerClass = $this->_routerClass;
     $routerInstance = new $routerClass();
     if (!isset($this->_expectModule)) {
         $this->_expectModule = $routerInstance->getDefaultModuleName();
     }
     if (!isset($this->_expectController)) {
         $this->_expectController = $routerInstance->getDefaultControllerName();
     }
     if (!isset($this->_expectAction)) {
         $this->_expectAction = $routerInstance->getDefaultActionName();
     }
     $postfix = "";
     if (isset($this->_requiredModule)) {
         $this->_router->requireModule($this->_requiredModule);
         if ($this->_requiredModule) {
             $postfix .= "(module '{$this->_requiredModule}' required)";
         } else {
             $postfix .= '(module required)';
         }
     }
     if (isset($this->_requiredController)) {
         $this->_router->requireController($this->_requiredController);
         if ($this->_requiredController) {
             $postfix .= "(controller '{$this->_requiredController}' required)";
         } else {
             $postfix .= '(controller required)';
         }
     }
     if (isset($this->_requiredAction)) {
         $this->_router->requireAction($this->_requiredAction);
         if ($this->_requiredAction) {
             $postfix .= "(action '{$this->_requiredAction}' required)";
         } else {
             $postfix .= '(action required)';
         }
     }
     $routable = $this->_router->route($this->_uri);
     if ($this->_isRoutable) {
         $this->_test->assertTrue($routable, "{$this->_routerClass} router should be able to route '{$this->_uri}' " . $postfix);
     } else {
         $this->_test->assertFalse($routable, "{$this->_routerClass} router should not be able to route '{$this->_uri}' " . $postfix);
         return;
     }
     $this->_test->assertEquals($this->_expectModule, $this->_router->getModuleName(), "{$this->_routerClass} routes {$this->_uri} to module '{$this->_expectModule}'");
     $this->_test->assertEquals($this->_expectController, $this->_router->getControllerName(), "{$this->_routerClass} routes {$this->_uri} to controller '{$this->_expectController}'");
     $this->_test->assertEquals($this->_expectAction, $this->_router->getActionName(), "{$this->_routerClass} routes {$this->_uri} to action '{$this->_expectAction}'");
     $this->_test->assertEquals($this->_expectArguments, $this->_router->getActionArguments(), "{$this->_routerClass} gets " . var_export($this->_expectArguments, true) . " from uri '{$this->_uri}'");
 }
开发者ID:WebSpider,项目名称:OpenConext-engineblock,代码行数:50,代码来源:AssertionBuilder.php

示例4: doStrictMethodCheck

 /**
  * @return void
  */
 protected function doStrictMethodCheck()
 {
     if ($this->isStatic()) {
         $errMsg = "#{$this->methodName} is an instance method on the class {$this->className}, but you expected it to be static.";
     } else {
         $errMsg = "#{$this->methodName} is a static method on the class {$this->className}, but you expected it to be an instance method.";
     }
     try {
         $reflectionMethod = new \ReflectionMethod($this->className, $this->methodName);
         $this->testCase->assertTrue($reflectionMethod->isStatic() == $this->isStatic(), $errMsg);
         $this->testCase->assertFalse($reflectionMethod->isPrivate(), "#{$this->methodName} is a private method on {$this->className}, but you cannot mock a private method.");
     } catch (\ReflectionException $e) {
         $necessaryMagicMethod = $this->isStatic() ? '__callStatic' : '__call';
         $this->testCase->assertTrue(method_exists($this->className, $necessaryMagicMethod), "The method #{$this->methodName} does not exist on the class {$this->className}");
     }
 }
开发者ID:box,项目名称:shmock,代码行数:19,代码来源:StaticSpec.php

示例5: it_generates_a_frontend_config_object

 public function it_generates_a_frontend_config_object()
 {
     $config = new Config();
     $config->load(SpecHelper::rootPath() . 'src/BackbonePhp/Application/config/application.json');
     $config->load(SpecHelper::rootPath() . 'src/BackbonePhp/Application/config/groups.json');
     $config->load(SpecHelper::rootPath() . 'src/BackbonePhp/Application/config/models.json');
     $config->load(SpecHelper::rootPath() . 'src/BackbonePhp/Application/config/permissions.json');
     $this->config = $config;
     $request = new Request();
     $response = new Response();
     $route = (object) [];
     $this->handleFrontendConfigRequest($request, $response, $route)->shouldReturn($this);
     Assertions::assertEquals('application/json', $response->getHeader('Content-Type'), 'should set content type to JSON');
     Assertions::assertEquals('BackbonePHP', $response->getBody()->appName, 'should set status field');
     Assertions::assertFalse(isset($response->getBody()->groups), 'should net expose user groups');
     Assertions::assertFalse(isset($response->getBody()->permissions), 'should net expose permissions');
 }
开发者ID:bnowack,项目名称:backbone-php,代码行数:17,代码来源:ConfigControllerSpec.php

示例6: assertClassDoesNotExist

 /**
  * Assert class exist.
  *
  * @param string $class
  */
 protected static function assertClassDoesNotExist($class)
 {
     $classIncluded = class_exists($class);
     parent::assertFalse($classIncluded);
 }
开发者ID:exorg,项目名称:autoloader,代码行数:10,代码来源:AutoloadingProcessTestCase.php

示例7: assert

 public function assert()
 {
     $this->getTestCase()->assertElementExists($this->selector, $this->by);
     \PHPUnit_Framework_TestCase::assertFalse($this->webDriver->{$this->by}($this->selector)->isDisplayed(), sprintf('The element: %s, is displayed and it should not have been', $this->selector));
 }
开发者ID:kschroeder,项目名称:Magium,代码行数:5,代码来源:NotDisplayed.php

示例8: assertFalse

 /**
  * @deprecated since 2.3
  * @static
  * @param mixed $actual
  * @param string $messages
  * @return void
  */
 public static function assertFalse($actual, $messages = '')
 {
     parent::assertFalse((bool) $actual, $messages);
 }
开发者ID:numbas,项目名称:moodle,代码行数:11,代码来源:lib.php

示例9: assertFalse

 static function assertFalse($actual, $string = '')
 {
     parent::assertFalse((bool) $actual, $string);
 }
开发者ID:ryanshoover,项目名称:core,代码行数:4,代码来源:bootstrap.php

示例10: elementShouldNotHaveClass

 /**
  * Checks an element doesn't have a class
  *
  * @Then /^"([^"]*)" element should not have class "([^"]*)"$/
  *
  * @return void
  */
 public function elementShouldNotHaveClass($selector, $class)
 {
     $session = $this->getSession();
     $page = $session->getPage();
     $element = $page->find('css', $selector);
     if (!$element) {
         throw new ElementNotFoundException($session, 'Element "' . $selector . '"');
     }
     \PHPUnit_Framework_TestCase::assertFalse($element->hasClass($class));
 }
开发者ID:neemzy,项目名称:patchwork-core,代码行数:17,代码来源:FeatureContext.php

示例11: assertClassNotLoaded

 /**
  * Create an additional assertion to ensure the specified class is not
  * loaded when executing a test
  *
  * @param string $className
  * @param \PHPUnit_Framework_TestCase $test
  */
 private function assertClassNotLoaded($className, \PHPUnit_Framework_TestCase $test)
 {
     $test->assertFalse(class_exists($className, false), 'Class ' . $className . ' was loaded during test ' . $this->getCurrentTestName($test));
 }
开发者ID:AydinHassan,项目名称:BetterReflection,代码行数:11,代码来源:TestListener.php

示例12: iShouldNotSeeElement

 /**
  * @Then I should not see :arg1 element
  */
 public function iShouldNotSeeElement($locator)
 {
     PHPUnit_Framework_TestCase::assertFalse($this->isElemetPresentByXpath($locator), 'can see ' . $locator . ' element on the page');
 }
开发者ID:shravanmechineni,项目名称:Shravan_Tests,代码行数:7,代码来源:ReusableContext.php


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