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


PHP assertNull函数代码示例

本文整理汇总了PHP中assertNull函数的典型用法代码示例。如果您正苦于以下问题:PHP assertNull函数的具体用法?PHP assertNull怎么用?PHP assertNull使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: 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

示例2: test_it_destroys_page

 public function test_it_destroys_page()
 {
     $this->RoutesGenerator->shouldReceive('cacheRoutes')->once();
     $this->PageManager->destroyPage(1);
     $deletedPage = \DvsPage::find(1);
     assertNull($deletedPage);
 }
开发者ID:alpas29,项目名称:cms,代码行数:7,代码来源:PageManagerTest.php

示例3: test_it_can_recover_password

 public function test_it_can_recover_password()
 {
     $input = ['_token' => 'someFooTokenJASdad', 'email' => 'foo@email.com'];
     $this->Framework->Password->shouldReceive('sendResetLink')->andReturn('passwords.sent');
     // check null is returned
     assertNull($this->SessionsRepository->recoverPassword($input));
     // check SessionsRepo messages attribute equals string
     assertEquals('Recovery email has been sent.', $this->SessionsRepository->message);
 }
开发者ID:alpas29,项目名称:cms,代码行数:9,代码来源:SessionsRepositoryTest.php

示例4: gets_value_from_user_input

 /**
  * @test
  * @covers Mobileka\ScopeApplicator\Yii2\InputManager::get
  */
 public function gets_value_from_user_input()
 {
     $im = new Mobileka\ScopeApplicator\Yii2\InputManager();
     assertNull($im->get('param'));
     assertSame('no such param', $im->get('param', 'no such param'));
     // add something to request parameters
     $im->setQueryParams(['param' => 'hello']);
     assertEquals('hello', $im->get('param'));
 }
开发者ID:mobileka,项目名称:scope-applicator-yii2,代码行数:13,代码来源:InputManagerTest.php

示例5: gets_value_from_user_input

 /**
  * @test
  * @covers Mobileka\ScopeApplicator\Laravel\InputManager::get
  */
 public function gets_value_from_user_input()
 {
     $lim = new Mobileka\ScopeApplicator\Laravel\InputManager();
     assertNull($lim->get('param'));
     assertSame('no such param', $lim->get('param', 'no such param'));
     // add something to request parameters
     $lim->inputManager->query->set('param', 'hello');
     assertEquals('hello', $lim->get('param'));
 }
开发者ID:mobileka,项目名称:scope-applicator-laravel,代码行数:13,代码来源:InputManagerTest.php

示例6: testInteraction

 public function testInteraction()
 {
     // --- test behavior
     // notice we use separate objects the two, we just want to test similar behavior
     // not interaction
     $details = new CustomerDetail();
     $source = Datasource::make(new CustomerDetail());
     $source['biography'] = 'A nice life!';
     $source['accepts_cookies'] = 0;
     // eloquent always report false, datasource will report false or true
     assertFalse(isset($details->customer));
     assertFalse(isset($source['customer']));
     assertNull($details->customer);
     assertNull($source['customer']);
 }
开发者ID:tacone,项目名称:datasource,代码行数:15,代码来源:BelongsToOneTest.php

示例7: testInteraction

 public function testInteraction()
 {
     // --- test behavior
     // notice we use separate objects the two, we just want to test similar behavior
     // not interaction
     $customer = new Customer();
     $source = Datasource::make(new Customer());
     $source['name'] = 'Frank';
     $source['surname'] = 'Sinatra';
     // eloquent always report false, datasource will report false or true
     assertFalse(isset($customer->details));
     assertFalse(isset($source['details']));
     assertNull($customer->details);
     assertNull($source['details']);
 }
开发者ID:tacone,项目名称:datasource,代码行数:15,代码来源:HasOneTest.php

示例8: testUnset

 public function testUnset()
 {
     $this->createModels(Order::class, $array = [['code' => 'a1', 'shipping' => 'home', 'customer_id' => 1], ['code' => 'b1', 'shipping' => 'office', 'customer_id' => 1]]);
     $collection = Order::all();
     $source = DataSource::make($collection);
     assertInstanceOf(Order::class, $source[0]);
     assertInstanceOf(Order::class, $source[1]);
     assertInstanceOf(Order::class, $collection[0]);
     assertInstanceOf(Order::class, $collection[1]);
     unset($source[0]);
     assertNull($source[0]);
     assertInstanceOf(Order::class, $source[1]);
     assertTrue(!isset($collection[0]));
     assertInstanceOf(Order::class, $collection[1]);
     unset($source[1]);
     assertNull($source[1]);
     assertTrue(!isset($collection[1]));
 }
开发者ID:tacone,项目名称:datasource,代码行数:18,代码来源:EloquentCollectionTest.php

示例9: thereIsAnEmailFromToTitled

 /**
  * @Given /^there should (not |)be an email (to|from) "([^"]*)" titled "([^"]*)"$/
  */
 public function thereIsAnEmailFromToTitled($negate, $direction, $email, $subject)
 {
     $to = $direction == 'to' ? $email : null;
     $from = $direction == 'from' ? $email : null;
     $match = $this->mailer->findEmail($to, $from, $subject);
     $allMails = $this->mailer->findEmails($to, $from);
     $allTitles = $allMails ? '"' . implode('","', array_map(function ($email) {
         return $email->Subject;
     }, $allMails)) . '"' : null;
     if (trim($negate)) {
         assertNull($match);
     } else {
         $msg = sprintf('Could not find email %s "%s" titled "%s".', $direction, $email, $subject);
         if ($allTitles) {
             $msg .= ' Existing emails: ' . $allTitles;
         }
         assertNotNull($match, $msg);
     }
     $this->lastMatchedEmail = $match;
 }
开发者ID:helpfulrobot,项目名称:silverstripe-behat-extension,代码行数:23,代码来源:EmailContext.php

示例10: firstReturnsNullForEmptyInput

 /**
  * @test
  */
 public function firstReturnsNullForEmptyInput()
 {
     assertNull(Sequence::of([])->first());
 }
开发者ID:stubbles,项目名称:stubbles-sequence,代码行数:7,代码来源:SequenceTest.php

示例11: test_connect

 function test_connect()
 {
     $db = new DB();
     assertNull($db->db);
 }
开发者ID:MarauderXtreme,项目名称:RPG-Community,代码行数:5,代码来源:DBTest.php

示例12: assertElementNotOnPage

 /**
  * Checks, that element with specified CSS doesn't exist on page.
  *
  * @Then /^(?:|I )should not see an? "(?P<element>[^"]*)" element$/
  */
 public function assertElementNotOnPage($element)
 {
     try {
         assertNull($this->getSession()->getPage()->find('css', $element));
     } catch (AssertException $e) {
         $message = sprintf('An element matching css "%s" appears on this page, but it should not.', $element);
         throw new ExpectationException($message, $this->getSession(), $e);
     }
 }
开发者ID:kingsj,项目名称:core,代码行数:14,代码来源:BaseMinkContext.php

示例13: test_gets_an_array_of_target_arrays_values_matching_a_regex

 /**
  * @covers Mobileka\MosaicArray\MosaicArray::pregValues
  */
 public function test_gets_an_array_of_target_arrays_values_matching_a_regex()
 {
     $target = ['key' => 'VALUE', 'hello' => 'World', 'Mosaic' => 'Soft'];
     $ma = new MosaicArray($target);
     // should not be found
     $result = $ma->pregValues('/^\\d{5}$/');
     assertNull($result);
     $expect = 'Mosaic Soft';
     $result = $ma->pregValues('/^\\d{5}$/', 'Mosaic Soft');
     assertEquals($expect, $result);
     $expect = ['World', 'Soft'];
     $result = $ma->pregValues('/^.*o.*$/');
     assertEquals($expect, $result);
     $expect = ['VALUE'];
     $result = $ma->pregValues('/^.*ALU.*$/');
     assertEquals($expect, $result);
 }
开发者ID:mobileka,项目名称:mosaic-array,代码行数:20,代码来源:MosaicArrayTest.php

示例14: iShouldNotBeAbleToSelectFromTheWayf

 /**
  * @Then /^I should not be able to select "([^"]*)" from the WAYF$/
  */
 public function iShouldNotBeAbleToSelectFromTheWayf($behavIdp)
 {
     $button = $this->getMainContext()->getSession()->getPage()->findButton($behavIdp);
     assertNull($button);
 }
开发者ID:newlongwhitecloudy,项目名称:OpenConext-engineblock,代码行数:8,代码来源:TestSp.php

示例15: iShouldNotSeeTheTab

 /**
  * @Then /^I should not see the "([^"]*)" tab$/
  */
 public function iShouldNotSeeTheTab($tab)
 {
     assertNull($this->getCurrentPage()->getFormTab($tab));
 }
开发者ID:a2xchip,项目名称:pim-community-dev,代码行数:7,代码来源:WebUser.php


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