本文整理汇总了PHP中PHPUnit_Framework_Assert::assertArrayNotHasKey方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::assertArrayNotHasKey方法的具体用法?PHP PHPUnit_Framework_Assert::assertArrayNotHasKey怎么用?PHP PHPUnit_Framework_Assert::assertArrayNotHasKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Assert
的用法示例。
在下文中一共展示了PHPUnit_Framework_Assert::assertArrayNotHasKey方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assertViewMissing
/**
* Assert that the response view is missing a piece of bound data.
*
* @param string $key
* @return void
*/
public function assertViewMissing($key)
{
if (!isset($this->response->original) || !$this->response->original instanceof View) {
return PHPUnit::assertTrue(false, 'The response was not a view.');
}
PHPUnit::assertArrayNotHasKey($key, $this->response->original->getData());
}
示例2: testIncomingInvalidatedTransactionUpdatesLedgerEntries
public function testIncomingInvalidatedTransactionUpdatesLedgerEntries()
{
$provisional_tx_repository = app('App\\Repositories\\ProvisionalTransactionRepository');
$notification_repository = app('App\\Repositories\\NotificationRepository');
$ledger_entry_repository = app('App\\Repositories\\LedgerEntryRepository');
// setup monitors
$payment_address_helper = app('PaymentAddressHelper');
$payment_address_one = $payment_address_helper->createSamplePaymentAddressWithoutInitialBalances(null, ['address' => '1JztLWos5K7LsqW5E78EASgiVBaCe6f7cD']);
// receive unconfirmed transactions
$parsed_txs = $this->receiveUnconfirmedTransactions(1);
// check accounts
$account_one = AccountHandler::getAccount($payment_address_one, 'default');
$balance = $ledger_entry_repository->accountBalancesByAsset($account_one, null);
PHPUnit::assertEquals(0.004, $balance['unconfirmed']['BTC']);
// now confirm a malleated version of the transaction
$malleated_tx = $parsed_txs[0];
$malleated_tx['txid'] = str_repeat('0', 54) . 'MALLEATED1';
$malleated_txs = [$malleated_tx];
// now confirm the malleated transaction (with 2 confirmations)
$this->sendConfirmationEvents(2, $malleated_txs);
// check for invalidation notification
$balance = $ledger_entry_repository->accountBalancesByAsset($account_one, null);
PHPUnit::assertEquals(0.004, $balance['confirmed']['BTC']);
PHPUnit::assertArrayNotHasKey('BTC', $balance['unconfirmed']);
}
示例3: it_detects_proper_values_and_constants
/**
* @test
*/
public function it_detects_proper_values_and_constants()
{
$enum = new FakeEnum();
\PHPUnit_Framework_Assert::assertContains('SOME_KEY', $enum->keys());
\PHPUnit_Framework_Assert::assertArrayHasKey('SOME_KEY', $enum->values());
\PHPUnit_Framework_Assert::assertArrayNotHasKey('some-value', $enum->values());
\PHPUnit_Framework_Assert::assertContains('some-value', $enum->values());
\PHPUnit_Framework_Assert::assertSame('SOME_KEY', $enum->getConstantForValue('some-value'));
\PHPUnit_Framework_Assert::assertTrue($enum->has('some-value'));
\PHPUnit_Framework_Assert::assertFalse($enum->has('SOME-VALUE'));
}
示例4: assertArrayNotHasKey
/**
* Asserts that an array does not have a specified key.
*
* @param mixed $key
* @param array $array
* @param string $message
* @since Method available since Release 3.0.0
*/
function assertArrayNotHasKey($key, array $array, $message = '')
{
return PHPUnit_Framework_Assert::assertArrayNotHasKey($key, $array, $message);
}
示例5: toHaveKey
public function toHaveKey($key)
{
if ($this->negate) {
a::assertArrayNotHasKey($key, $this->actual);
} else {
a::assertArrayHasKey($key, $this->actual);
}
}
示例6: it_can_receive_due_scheduled_commands
public function it_can_receive_due_scheduled_commands()
{
$date = new \DateTimeImmutable();
$timestamp = $date->getTimestamp();
$lua = $this->getLua('receive_due_messages');
$this->adapter->evalLua($lua, ['test', 0, $timestamp, SchedulerWorker::DEFAULT_THROTTLE])->shouldBeCalled()->willReturn([['test', 'test', 'test', $timestamp]]);
$commandsWrapper = $this->receiveDueCommands($date);
$commands = $commandsWrapper->getWrappedObject();
\PHPUnit_Framework_Assert::assertArrayHasKey(0, $commands);
\PHPUnit_Framework_Assert::assertArrayNotHasKey(1, $commands);
\PHPUnit_Framework_Assert::assertEquals('test', $commands[0]->getId());
}
示例7: hasntKey
public function hasntKey($key)
{
a::assertArrayNotHasKey($key, $this->actual, $this->description);
}
示例8: notToHaveKey
/**
* Expect that an array does not have a specified key.
*
* @param mixed $key
* @param string $message
*
* @return Expect
*/
public function notToHaveKey($key, $message = '')
{
Assert::assertArrayNotHasKey($key, $this->value, $message);
return $this;
}
示例9: arrayToNotHaveKey
public function arrayToNotHaveKey($key)
{
\PHPUnit_Framework_Assert::assertArrayNotHasKey($key, $this->actual);
}
示例10: theResponseShouldNotHaveAField
/**
* @Then /^in the response there is no field called "([^"]*)"$/
* @param string $name
* @return void
* @throws \Exception
*/
public function theResponseShouldNotHaveAField($name)
{
Assertions::assertArrayNotHasKey($name, $this->getResponseData());
}
示例11: thereShouldNotBeParameter
/**
* @Then /^there should not be "([^"]*)" parameter$/
*/
public function thereShouldNotBeParameter($key)
{
\PHPUnit_Framework_Assert::assertArrayNotHasKey($key, $this->containerParameters);
}
示例12: assertArrayNotHasKey
/**
* @param $key
* @param $actual
* @param $description
*/
protected function assertArrayNotHasKey($key, $actual, $description)
{
\PHPUnit_Framework_Assert::assertArrayNotHasKey($key, $actual, $description);
}