本文整理汇总了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());
}
示例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);
}
示例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);
}
示例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'));
}
示例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'));
}
示例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']);
}
示例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']);
}
示例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]));
}
示例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;
}
示例10: firstReturnsNullForEmptyInput
/**
* @test
*/
public function firstReturnsNullForEmptyInput()
{
assertNull(Sequence::of([])->first());
}
示例11: test_connect
function test_connect()
{
$db = new DB();
assertNull($db->db);
}
示例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);
}
}
示例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);
}
示例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);
}
示例15: iShouldNotSeeTheTab
/**
* @Then /^I should not see the "([^"]*)" tab$/
*/
public function iShouldNotSeeTheTab($tab)
{
assertNull($this->getCurrentPage()->getFormTab($tab));
}