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


PHP PHPUnit_Framework_Assert::assertNull方法代码示例

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


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

示例1: testPruneOldTransactions

 public function testPruneOldTransactions()
 {
     $tx_helper = app('SampleTransactionsHelper');
     $created_txs = [];
     for ($i = 0; $i < 5; $i++) {
         $created_txs[] = $tx_helper->createSampleTransaction('sample_xcp_parsed_01.json', ['txid' => str_repeat('0', 63) . ($i + 1)]);
     }
     $tx_repository = app('App\\Repositories\\TransactionRepository');
     $created_txs[0]->timestamps = false;
     $tx_repository->update($created_txs[0], ['updated_at' => time() - 60], ['timestamps' => false]);
     $created_txs[1]->timestamps = false;
     $tx_repository->update($created_txs[1], ['updated_at' => time() - 59], ['timestamps' => false]);
     $created_txs[2]->timestamps = false;
     $tx_repository->update($created_txs[2], ['updated_at' => time() - 5], ['timestamps' => false]);
     // prune all
     $this->dispatch(new PruneTransactions(50));
     // check that all transactions were erased
     $tx_repository = app('App\\Repositories\\TransactionRepository');
     foreach ($created_txs as $offset => $created_tx) {
         $loaded_tx = $tx_repository->findByTXID($created_tx['txid']);
         if ($offset < 2) {
             PHPUnit::assertNull($loaded_tx, "found unexpected tx: " . ($loaded_tx ? json_encode($loaded_tx->toArray(), 192) : 'null'));
         } else {
             PHPUnit::assertNotNull($loaded_tx, "missing tx {$offset}");
             PHPUnit::assertEquals($created_tx->toArray(), $loaded_tx->toArray());
         }
     }
 }
开发者ID:CryptArc,项目名称:xchain,代码行数:28,代码来源:PruneTransactionsTest.php

示例2: testGetEmptyComposedTransactionsByUnknownRequestID

 public function testGetEmptyComposedTransactionsByUnknownRequestID()
 {
     $repository = app('App\\Repositories\\ComposedTransactionRepository');
     $request_id = 'unknownreqid01';
     // load the empty composed transaction
     $loaded_transactions = $repository->getComposedTransactionByRequestID($request_id);
     PHPUnit::assertNull($loaded_transactions);
 }
开发者ID:CryptArc,项目名称:xchain,代码行数:8,代码来源:ComposedTransactionRepositoryTest.php

示例3: assertLockDiscoveryPropertyNowhere

 public function assertLockDiscoveryPropertyNowhere(ezcWebdavMemoryBackend $backend)
 {
     $prop = $backend->getProperty('/collection', 'lockdiscovery');
     PHPUnit_Framework_Assert::assertNull($prop);
     $prop = $backend->getProperty('/collection/resource.html', 'lockdiscovery');
     PHPUnit_Framework_Assert::assertType('ezcWebdavLockDiscoveryProperty', $prop, 'Property has incorrect type.');
     PHPUnit_Framework_Assert::assertEquals(0, count($prop->activeLock), 'Active lock element not removed correctly.');
 }
开发者ID:bmdevel,项目名称:ezc,代码行数:8,代码来源:008_unlock_resource_success_assertions.php

示例4: tearDownAfterClass

 /**
  * Cleans up the environment after running a test.
  */
 public static function tearDownAfterClass()
 {
     // fwrite(STDOUT, __METHOD__ . "\n");
     // Delete User for forum test
     self::$userPDO->delete(SELF::USER_ID);
     $retUser = self::$userPDO->get(SELF::USER_ID);
     PHPUnit_Framework_Assert::assertNull($retUser);
     // Delete Test Forum
     self::$forumPDO->deleteForum(self::$forumId);
     $testForum = self::$forumPDO->getForum(self::$forumId);
     PHPUnit_Framework_Assert::assertNull($testForum);
 }
开发者ID:szwork2013,项目名称:impulse,代码行数:15,代码来源:ForumPostServicePDOTest.php

示例5: testSetterAndGetter

 public function testSetterAndGetter()
 {
     $user = new UserDefault();
     PHPUnit::assertInstanceOf(DateTime::class, $user->getCreatedAt());
     PHPUnit::assertInstanceOf(DateTime::class, $user->getUpdatedAt());
     PHPUnit::assertNull($user->getDeletedAt());
     PHPUnit::assertSame('user', $user->getRole()->getName());
     $role = new UserRoleDefault('test');
     $user->setRole($role);
     PHPUnit::assertSame($role, $user->getRole());
     PHPUnit::assertFalse($user->isEnabled());
     $user->enable();
     PHPUnit::assertTrue($user->isEnabled());
     $user->disable();
     PHPUnit::assertFalse($user->isEnabled());
 }
开发者ID:raptorlab,项目名称:veloci,代码行数:16,代码来源:UserDefaultTest.php

示例6: testPruneOldBlocks

 public function testPruneOldBlocks()
 {
     $block_helper = app('SampleBlockHelper');
     $created_blocks = [];
     for ($i = 0; $i < 5; $i++) {
         $created_blocks[] = $block_helper->createSampleBlock('default_parsed_block_01.json', ['hash' => str_repeat('0', 63) . ($i + 1), 'height' => 10001 + $i]);
     }
     // prune last 3
     $this->dispatch(new PruneBlocks(3));
     $block_repository = app('App\\Repositories\\BlockRepository');
     foreach ($created_blocks as $offset => $created_block) {
         $loaded_block = $block_repository->findByHash($created_block['hash']);
         if ($offset < 2) {
             PHPUnit::assertNull($loaded_block, "found unexpected block: " . ($loaded_block ? json_encode($loaded_block->toArray(), 192) : 'null'));
         } else {
             PHPUnit::assertNotNull($loaded_block, "missing block {$offset}");
             PHPUnit::assertEquals($created_block->toArray(), $loaded_block->toArray());
         }
     }
 }
开发者ID:CryptArc,项目名称:xchain,代码行数:20,代码来源:PruneBlocksTest.php

示例7: testExhangeBind

 public function testExhangeBind()
 {
     $ch = $this->prepareAMQPChannel('channel_id');
     $con = $this->prepareAMQPConnection();
     $source = 'example_source';
     $destination = 'example_destination';
     $key = 'example_key';
     $ch->expects($this->once())->method('exchange_bind')->will($this->returnCallback(function ($d, $s, $k, $n, $a) use($destination, $source, $key) {
         \PHPUnit_Framework_Assert::assertSame($destination, $d);
         \PHPUnit_Framework_Assert::assertSame($source, $s);
         \PHPUnit_Framework_Assert::assertSame($key, $k);
         \PHPUnit_Framework_Assert::assertFalse($n);
         \PHPUnit_Framework_Assert::assertNull($a);
     }));
     $binding = $this->getBinding($con, $ch);
     $binding->setExchange($source);
     $binding->setDestination($destination);
     $binding->setRoutingKey($key);
     $binding->setDestinationIsExchange(true);
     $binding->setupFabric();
 }
开发者ID:danut007ro,项目名称:RabbitMqBundle,代码行数:21,代码来源:BindingTest.php

示例8: test

 public function test()
 {
     $object = new UserDefault();
     $type = UserDefault::class;
     $metadata = new ObjectMetadata($object);
     PHPUnit::assertEquals($type, $metadata->getType());
     PHPUnit::assertNotEquals(10, $object->getId());
     $metadata->setValue($object, 'id', 10);
     PHPUnit::assertEquals(10, $object->getId());
     PHPUnit::assertEquals(new \ReflectionClass($object), $metadata->getReflectionClass());
     try {
         $metadata->getProperty('thisPropertyDoesNotExists', true);
         PHPUnit::fail('Must raise an exception');
     } catch (\RuntimeException $ex) {
     }
     $property = $metadata->getProperty('thisPropertyDoesNotExists');
     PHPUnit::assertNull($property);
     $properties = $metadata->getProperties();
     $type = $metadata->getType();
     $object = unserialize(serialize($metadata));
     PHPUnit::assertEquals($properties, $object->getProperties());
     PHPUnit::assertEquals($type, $object->getType());
     PHPUnit::assertEquals($metadata, $object);
 }
开发者ID:raptorlab,项目名称:veloci,代码行数:24,代码来源:ObjectMetadataTest.php

示例9: toBeNull

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

示例10: assertLockDiscoveryPropertyNowhereElse

 public function assertLockDiscoveryPropertyNowhereElse(ezcWebdavMemoryBackend $backend)
 {
     $prop = $backend->getProperty('/collection', 'lockdiscovery');
     PHPUnit_Framework_Assert::assertNull($prop);
 }
开发者ID:bmdevel,项目名称:ezc,代码行数:5,代码来源:003_lock_null_resource_success_assertions.php

示例11: dontSeeOptionIsSelected

 public function dontSeeOptionIsSelected($select, $text)
 {
     $option = $this->findSelectedOption($select);
     if (!$option) {
         \PHPUnit_Framework_Assert::assertNull($option);
         return;
     }
     $this->assertNotEquals($text, $option->getText());
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:9,代码来源:Mink.php

示例12: dontSeeHttpHeader

 /**
  * Checks over the given HTTP header and (optionally)
  * its value, asserting that are not there
  *
  * @param $name
  * @param $value
  */
 public function dontSeeHttpHeader($name, $value = null)
 {
     if ($value) {
         \PHPUnit_Framework_Assert::assertNotEquals($this->client->getInternalResponse()->getHeader($name), $value);
     } else {
         \PHPUnit_Framework_Assert::assertNull($this->client->getInternalResponse()->getHeader($name));
     }
 }
开发者ID:huynt57,项目名称:bluebee-uet.com,代码行数:15,代码来源:REST.php

示例13: testBitcoinTransaction

 public function testBitcoinTransaction()
 {
     $parser = new Parser();
     $tx_data = $this->getSampleBitcoinTransaction();
     $type = $parser->lookupCounterpartyTransactionType($tx_data, 1);
     PHPUnit::assertNull($type);
 }
开发者ID:tokenly,项目名称:counterparty-transaction-parser,代码行数:7,代码来源:ParserTest.php

示例14: assertion

 function assertion($key, $value)
 {
     $test = new Test();
     $test->server('json_response', 'POST', array('key' => $key, 'value' => $value));
     $response = $test->curl->response;
     PHPUnit_Framework_Assert::assertNotNull($response);
     PHPUnit_Framework_Assert::assertNull($response->null);
     PHPUnit_Framework_Assert::assertTrue($response->true);
     PHPUnit_Framework_Assert::assertFalse($response->false);
     PHPUnit_Framework_Assert::assertTrue(is_int($response->integer));
     PHPUnit_Framework_Assert::assertTrue(is_float($response->float));
     PHPUnit_Framework_Assert::assertEmpty($response->empty);
     PHPUnit_Framework_Assert::assertTrue(is_string($response->string));
 }
开发者ID:canerdogan,项目名称:php-curl-class,代码行数:14,代码来源:PHPCurlClassTest.php

示例15: null

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


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