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


PHP assertFalse函数代码示例

本文整理汇总了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')));
 }
开发者ID:stubbles,项目名称:stubbles-reflect,代码行数:12,代码来源:AnnotationCacheTest.php

示例2: test_it_disables

 public function test_it_disables()
 {
     $DvsMagicMode = new DvsMagicMode();
     $DvsMagicMode->disable(true);
     assertFalse($DvsMagicMode->enabled());
     assertTrue($DvsMagicMode->disabled());
 }
开发者ID:alpas29,项目名称:cms,代码行数:7,代码来源:DvsMagicModeTest.php

示例3: testServiceAliasDefinition

 public function testServiceAliasDefinition()
 {
     $definition = new ServiceDefinition('service_name', ['service' => __CLASS__]);
     assertTrue($definition->isAlias());
     assertFalse($definition->isFactory());
     assertSame(__CLASS__, $definition->getClass());
 }
开发者ID:tomphp,项目名称:config-service-provider,代码行数:7,代码来源:ServiceDefinitionTest.php

示例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);
 }
开发者ID:tacone,项目名称:datasource,代码行数:26,代码来源:BelongsToOneTest.php

示例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);
 }
开发者ID:alpas29,项目名称:cms,代码行数:7,代码来源:SanityChecksHelperTest.php

示例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);
 }
开发者ID:giuseppe-mazzapica,项目名称:faber,代码行数:25,代码来源:StaticFaberTest.php

示例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());
            
        }
开发者ID:rdnorthup,项目名称:Hudson-PHP-Integration,代码行数:28,代码来源:EmptyTest.php

示例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);
 }
开发者ID:evalcodenet,项目名称:net.evalcode.components.type,代码行数:33,代码来源:annotations.php

示例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);
 }
开发者ID:alpas29,项目名称:cms,代码行数:7,代码来源:ApiPagesManagerTest.php

示例10: testCanValidatePasswordWithSymbols

 public function testCanValidatePasswordWithSymbols()
 {
     $validator = $this->createValidator();
     $validator->setMinSymbols(2);
     assertTrue($validator->isValid('!pass.word'));
     assertFalse($validator->isValid('1N3RD007'));
 }
开发者ID:eburhan,项目名称:password.php,代码行数:7,代码来源:ValidatorTest.php

示例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));
     }
 }
开发者ID:jacko972,项目名称:pim-community-dev,代码行数:13,代码来源:AssertionContext.php

示例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));
 }
开发者ID:JustAHappyKid,项目名称:bitcoin-chipin,代码行数:9,代码来源:change-password.php

示例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'));
 }
开发者ID:alpas29,项目名称:cms,代码行数:9,代码来源:RuleListTest.php

示例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());
}
开发者ID:JustAHappyKid,项目名称:bitcoin-chipin,代码行数:10,代码来源:widgets.php

示例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"));
 }
开发者ID:JustAHappyKid,项目名称:bitcoin-chipin,代码行数:14,代码来源:ui.php


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