本文整理汇总了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');
}
示例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);
}
示例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}'");
}
示例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}");
}
}
示例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');
}
示例6: assertClassDoesNotExist
/**
* Assert class exist.
*
* @param string $class
*/
protected static function assertClassDoesNotExist($class)
{
$classIncluded = class_exists($class);
parent::assertFalse($classIncluded);
}
示例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));
}
示例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);
}
示例9: assertFalse
static function assertFalse($actual, $string = '')
{
parent::assertFalse((bool) $actual, $string);
}
示例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));
}
示例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));
}
示例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');
}