本文整理汇总了PHP中assertFalse函数的典型用法代码示例。如果您正苦于以下问题:PHP assertFalse函数的具体用法?PHP assertFalse怎么用?PHP assertFalse使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了assertFalse函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: stoppingAnnotationPersistenceDoesNotWriteCacheFileOnShutdown
/**
* @since 3.0.0
* @group issue_58
* @test
*/
public function stoppingAnnotationPersistenceDoesNotWriteCacheFileOnShutdown()
{
AnnotationCache::put(new Annotations('someTarget'));
AnnotationCache::stop();
AnnotationCache::__shutdown();
assertFalse(file_exists(vfsStream::url('root/annotations.cache')));
}
示例2: test_it_disables
public function test_it_disables()
{
$DvsMagicMode = new DvsMagicMode();
$DvsMagicMode->disable(true);
assertFalse($DvsMagicMode->enabled());
assertTrue($DvsMagicMode->disabled());
}
示例3: testServiceAliasDefinition
public function testServiceAliasDefinition()
{
$definition = new ServiceDefinition('service_name', ['service' => __CLASS__]);
assertTrue($definition->isAlias());
assertFalse($definition->isFactory());
assertSame(__CLASS__, $definition->getClass());
}
示例4: testExistingChildren
public function testExistingChildren()
{
// --- test load
$this->createModels(CustomerDetail::class, []);
$this->createModels(Customer::class, [['name' => 'Frank', 'surname' => 'Sinatra']]);
$details = new CustomerDetail();
$source = Datasource::make(new CustomerDetail());
$source['id'] = 1;
$source['biography'] = 'A nice life!';
$source['accepts_cookies'] = 0;
$source['customer_id'] = 1;
$details->id = 1;
$details->biography = 'A nice life!';
$details->accepts_cookies = 0;
$details->customer_id = 1;
$source->save();
assertTrue(isset($source['customer']));
assertInstanceOf(Customer::class, $source['customer']);
assertModelArrayEqual(Customer::all()->toArray(), [$source['customer']->toArray()]);
// compare with how eloquent behaves:
$this->createModels(CustomerDetail::class, []);
$details->save();
assertFalse(isset($details->customer));
// always false!
assertInstanceOf(Customer::class, $details->customer);
}
示例5: test_sanity_check_fails_when_src_directory_fails
public function test_sanity_check_fails_when_src_directory_fails()
{
$this->MockSanityChecksScaffolding->shouldReceive('checkViewsDirectory')->times(1)->andReturn(true);
$this->MockSanityChecksScaffolding->shouldReceive('checkSrcDirectory')->times(1)->andReturn(false);
$result = $this->MockSanityChecksScaffolding->runSanityCheck($this->constants, [], []);
assertFalse($result);
}
示例6: testInstance
function testInstance()
{
$faber = F::instance('test');
$faber['foo'] = function () {
return new Stub();
};
$faber2 = F::instance('test');
$faber3 = F::instance('test2');
$faber3['foo'] = function () {
return new Stub();
};
$a = $faber['foo'];
$b = $faber['foo'];
$c = $faber2['foo'];
$d = $faber3['foo'];
assertInstanceOf('GM\\Faber\\Tests\\Stub', $a);
assertInstanceOf('GM\\Faber\\Tests\\Stub', $b);
assertInstanceOf('GM\\Faber\\Tests\\Stub', $c);
assertInstanceOf('GM\\Faber\\Tests\\Stub', $d);
assertTrue($a === $b);
assertTrue($b === $c);
assertFalse($c === $d);
assertTrue($faber === $faber2);
assertFalse($faber2 === $faber3);
}
示例7: testState
public function testState()
{
assertNull($this->objMath->getFirstOperand());
assertNull($this->objMath->getSecondOperand());
assertNull($this->objMath->getFirstOperator());
assertNull($this->objMath->getSecondOperator());
assertFalse( $this->objMath->validate() );
$this->objMath->setFirstOperand('5');
$this->objMath->setFirstOperator('+');
$this->objMath->setSecondOperand('2');
assertNotNull($this->objMath->getFirstOperand());
assertNotNull($this->objMath->getSecondOperand());
assertNotNull($this->objMath->getFirstOperator());
assertNotNull($this->objMath->getSecondOperator());
assertTrue( $this->objMath->validate() );
$this->objMath->clear( );
assertNull($this->objMath->getFirstOperand());
assertNull($this->objMath->getSecondOperand());
assertNull($this->objMath->getFirstOperator());
assertNull($this->objMath->getSecondOperator());
}
示例8: testParse
/**
* @test
* @profile fork
*/
public function testParse()
{
split_time('Reset');
$annotations = Annotations::get('Components\\Type_Test_Unit_Case_Annotations_Entity');
split_time('Invoke Annotations::get(Components\\Type_Test_Unit_Case_Annotations_Entity)');
$annotations = Annotations::get('Components\\Type_Test_Unit_Case_Annotations_Entity');
split_time('Invoke Annotations::get(Components\\Type_Test_Unit_Case_Annotations_Entity)');
assertTrue($annotations->hasTypeAnnotation(Annotation_Name::NAME));
split_time('Invoke Annotations$hasMethodAnnotation(name)');
assertTrue($annotations->hasTypeAnnotation(Annotation_Name::NAME));
split_time('Invoke Annotations$hasMethodAnnotation(name)');
assertTrue($annotations->hasTypeAnnotation('package'));
split_time('Invoke Annotations$hasMethodAnnotation(package)');
assertFalse($annotations->hasTypeAnnotation('version'));
split_time('Invoke Annotations$hasMethodAnnotation(version)');
assertTrue($annotations->hasMethodAnnotation('poke', Annotation_Name::NAME));
split_time('Invoke Annotations$hasMethodAnnotation(poke)');
assertTrue($annotations->hasMethodAnnotation('poke', Annotation_Name::NAME));
split_time('Invoke Annotations$hasMethodAnnotation(poke)');
$pokeName = $annotations->getMethodAnnotation('poke', Annotation_Name::NAME);
split_time('Invoke Annotations$getMethodAnnotation(poke)');
$pokeName = $annotations->getMethodAnnotation('poke', Annotation_Name::NAME);
split_time('Invoke Annotations$getMethodAnnotation(poke)');
$annotations = Annotations::get(__CLASS__);
split_time('Invoke Annotations::get(' . __CLASS__ . ')');
$annotations = Annotations::get(__CLASS__);
split_time('Invoke Annotations::get(' . __CLASS__ . ')');
assertEquals('poke', $pokeName->value);
}
示例9: test_it_cant_create_new_page
public function test_it_cant_create_new_page()
{
$this->PageVersionManager->shouldReceive('createDefaultPageVersion')->times(0);
$page = $this->ApiPagesManager->createNewPage(['title' => 'Some page title', 'slug' => '/some-page-title', 'http_verb' => 'get']);
assertFalse($page);
assertEquals(count($this->ApiPagesManager->errors), 1);
}
示例10: testCanValidatePasswordWithSymbols
public function testCanValidatePasswordWithSymbols()
{
$validator = $this->createValidator();
$validator->setMinSymbols(2);
assertTrue($validator->isValid('!pass.word'));
assertFalse($validator->isValid('1N3RD007'));
}
示例11: iShouldNotSeeValidationError
/**
* @param string $error
*
* @Then /^I should not see(?: a)? validation (?:error|tooltip) "([^"]*)"$/
*/
public function iShouldNotSeeValidationError($error)
{
if ($this->getSession()->getDriver() instanceof Selenium2Driver) {
$script = 'return $(\'.validation-tooltip[data-original-title="%s"]\').length > 0';
$found = $this->getSession()->evaluateScript(sprintf($script, $error));
assertFalse($found, sprintf('Expecting to not see validation error, "%s" found', $error));
}
}
示例12: testChangingPassword
function testChangingPassword()
{
$userB4 = $this->loginAsNormalUser();
assertFalse(Passwords\isValid('n00p@ss', $userB4->passwordEncrypted));
$this->get('/account/change-password');
$this->submitForm($this->getForm('change-password-form'), array('current-password' => 'abc123', 'password' => 'n00p@ss', 'confirm-password' => 'n00p@ss'));
$userAfter = User::loadFromID($userB4->id);
assertTrue(Passwords\isValid('n00p@ss', $userAfter->passwordEncrypted));
}
示例13: test_it_tells_us_if_we_are_not_in_groups
public function test_it_tells_us_if_we_are_not_in_groups()
{
$this->Framework->Auth->shouldReceive('check')->times(3)->andReturn(true);
$currentUser = $this->DvsUser->find(1);
$this->Framework->Auth->shouldReceive('user')->andReturn($currentUser);
assertTrue($this->RuleList->isNotInGroups('Group1', 'Group2'));
assertTrue($this->RuleList->isNotInGroups('Developer', 'Group1'));
assertFalse($this->RuleList->isNotInGroups('Developer', 'Developer'));
}
示例14: testDeterminingWhetherWidgetHasEndedOrNot
function testDeterminingWhetherWidgetHasEndedOrNot()
{
$w = getWidget();
$w->ending = new DateTime('-1 day');
assertTrue($w->hasEnded());
$w->ending = new DateTime((new DateTime('now'))->format('Y-m-d'));
assertFalse($w->hasEnded());
$w->ending = new DateTime('+1 day');
assertFalse($w->hasEnded());
}
示例15: testSigninYourAccountMenuIsNotDisplayedToNonAuthenticatedUser
/**
* A user that isn't logged in shouldn't see the "Your Account" menu (including, "Your Widgets",
* "Change Password", etc).
*/
function testSigninYourAccountMenuIsNotDisplayedToNonAuthenticatedUser()
{
$this->createHomepageWidgets();
$this->get('/account/signout');
$this->get('/');
assertFalse(contains($this->currentPageContent(), "Your Account"));
assertFalse(contains($this->currentPageContent(), "Change Password"));
assertFalse(contains($this->currentPageContent(), "Sign Out"));
assertTrue(contains($this->currentPageContent(), "Sign In"));
}