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


PHP PHPUnit_Framework_Assert::assertArrayNotHasKey方法代码示例

本文整理汇总了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());
 }
开发者ID:hilmysyarif,项目名称:sisfito,代码行数:13,代码来源:AssertionsTrait.php

示例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']);
 }
开发者ID:CryptArc,项目名称:xchain,代码行数:25,代码来源:ProvisionalTransactionsTest.php

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

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

示例5: toHaveKey

 public function toHaveKey($key)
 {
     if ($this->negate) {
         a::assertArrayNotHasKey($key, $this->actual);
     } else {
         a::assertArrayHasKey($key, $this->actual);
     }
 }
开发者ID:jasonmccreary,项目名称:expect,代码行数:8,代码来源:Expect.php

示例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());
 }
开发者ID:mgdigital,项目名称:busque,代码行数:12,代码来源:RedisDriverSpec.php

示例7: hasntKey

 public function hasntKey($key)
 {
     a::assertArrayNotHasKey($key, $this->actual, $this->description);
 }
开发者ID:jaschweder,项目名称:Verify,代码行数:4,代码来源:Verify.php

示例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;
 }
开发者ID:jpkleemans,项目名称:phpunit-expect,代码行数:13,代码来源:Expect.php

示例9: arrayToNotHaveKey

 public function arrayToNotHaveKey($key)
 {
     \PHPUnit_Framework_Assert::assertArrayNotHasKey($key, $this->actual);
 }
开发者ID:danrspencer,项目名称:phpunit-expect-syntax,代码行数:4,代码来源:Expector.php

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

示例11: thereShouldNotBeParameter

 /**
  * @Then /^there should not be "([^"]*)" parameter$/
  */
 public function thereShouldNotBeParameter($key)
 {
     \PHPUnit_Framework_Assert::assertArrayNotHasKey($key, $this->containerParameters);
 }
开发者ID:austinpapp,项目名称:push-notifications-temp,代码行数:7,代码来源:FeatureContext.php

示例12: assertArrayNotHasKey

 /**
  * @param $key
  * @param $actual
  * @param $description
  */
 protected function assertArrayNotHasKey($key, $actual, $description)
 {
     \PHPUnit_Framework_Assert::assertArrayNotHasKey($key, $actual, $description);
 }
开发者ID:janhenkgerritsen,项目名称:Codeception,代码行数:9,代码来源:Asserts.php


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