本文整理汇总了PHP中PHPUnit_Framework_Assert::assertNotEmpty方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::assertNotEmpty方法的具体用法?PHP PHPUnit_Framework_Assert::assertNotEmpty怎么用?PHP PHPUnit_Framework_Assert::assertNotEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Assert
的用法示例。
在下文中一共展示了PHPUnit_Framework_Assert::assertNotEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assertTableRowContains
/**
* @Then /^I should see "(?P<text>[^"]*)" in (?P<tableName>[\w\d\-]+) table row with "(?P<row>[^"]*)"$/
* @Then /^I should see "(?P<text>[^"]*)" in (?P<row>\d+)(st|nd|rd|th)? (?P<tableName>[\w\d\-]+) table row$/
*/
public function assertTableRowContains($text, $row, $tableName)
{
$table = $this->findTable($tableName);
$row = is_numeric($row) ? $table->getRow($row - 1) : $table->findRow($row);
Assert::assertNotEmpty($row, "Couldn't find row {$row} in table: " . PHP_EOL . $table->dump());
Assert::assertContains($text, $row, "Couldn't find {$text} in row " . $table->dumpRows(array($row)));
}
示例2: testAPICreatePrimes_1
public function testAPICreatePrimes_1()
{
$this->app->make('CounterpartySenderMockBuilder')->installMockCounterpartySenderDependencies($this->app, $this);
// setup
list($payment_address, $sample_txos) = $this->setupPrimes();
// api tester
$api_tester = $this->getAPITester();
$create_primes_vars = ['size' => CurrencyUtil::satoshisToValue(5430), 'count' => 3];
$response = $api_tester->callAPIWithAuthentication('POST', '/api/v1/primes/' . $payment_address['uuid'], $create_primes_vars);
$api_data = json_decode($response->getContent(), true);
PHPUnit::assertEquals(0, $api_data['oldPrimedCount']);
PHPUnit::assertEquals(3, $api_data['newPrimedCount']);
PHPUnit::assertNotEmpty($api_data['txid']);
PHPUnit::assertEquals(true, $api_data['primed']);
// check the composed transaction
$composed_transaction_raw = DB::connection('untransacted')->table('composed_transactions')->first();
$send_data = app('TransactionComposerHelper')->parseBTCTransaction($composed_transaction_raw->transaction);
$bitcoin_address = $payment_address['address'];
PHPUnit::assertCount(3, $send_data['change']);
PHPUnit::assertEquals($bitcoin_address, $send_data['destination']);
PHPUnit::assertEquals(5430, $send_data['btc_amount']);
PHPUnit::assertEquals($bitcoin_address, $send_data['change'][0][0]);
PHPUnit::assertEquals(5430, $send_data['change'][0][1]);
PHPUnit::assertEquals($bitcoin_address, $send_data['change'][1][0]);
PHPUnit::assertEquals(5430, $send_data['change'][1][1]);
}
示例3: theSelectFieldShouldBeFlaggedAsRequired
/**
* @Then the select field should be flagged as required
*/
public function theSelectFieldShouldBeFlaggedAsRequired()
{
$nodeElements = $this->getSession()->getPage()->findAll('css', sprintf('div.ezfield-identifier-%s fieldset select', self::$fieldIdentifier));
Assertion::assertNotEmpty($nodeElements, 'The select field is not marked as required');
foreach ($nodeElements as $nodeElement) {
Assertion::assertEquals('required', $nodeElement->getAttribute('required'), sprintf('select with id %s is not flagged as required', $nodeElement->getAttribute('id')));
}
}
示例4: _testCreate
protected function _testCreate()
{
if ($this->_model->getId()) {
\PHPUnit_Framework_Assert::fail("Can't run creation test for models with defined id");
}
$this->_model->save();
\PHPUnit_Framework_Assert::assertNotEmpty($this->_model->getId(), 'CRUD Create error');
}
示例5: processAssert
/**
* Assert that displayed breadcrumbs on category page equals to passed from fixture.
*
* @param BrowserInterface $browser
* @param Category $category
* @param CatalogCategoryView $catalogCategoryView
* @return void
*/
public function processAssert(BrowserInterface $browser, Category $category, CatalogCategoryView $catalogCategoryView)
{
$this->browser = $browser;
$this->openCategory($category);
$breadcrumbs = $this->getBreadcrumbs($category);
\PHPUnit_Framework_Assert::assertNotEmpty($breadcrumbs, 'No breadcrumbs on category \'' . $category->getName() . '\' page.');
$pageBreadcrumbs = $catalogCategoryView->getBreadcrumbs()->getText();
\PHPUnit_Framework_Assert::assertEquals($breadcrumbs, $pageBreadcrumbs, 'Wrong breadcrumbs of category page.' . "\nExpected: " . $breadcrumbs . "\nActual: " . $pageBreadcrumbs);
}
示例6: assertOperationsLinks
/**
* Checks the integrity of operations links.
*
* @param mixed[] $operations_links
*/
protected function assertOperationsLinks(array $operations_links)
{
foreach ($operations_links as $link) {
\PHPUnit_Framework_Assert::assertArrayHasKey('title', $link);
\PHPUnit_Framework_Assert::assertNotEmpty($link['title']);
\PHPUnit_Framework_Assert::assertArrayHasKey('url', $link);
\PHPUnit_Framework_Assert::assertInstanceOf(Url::class, $link['url']);
}
}
示例7: assertDataNotPersisted
/**
* @inheritdoc
*/
protected function assertDataNotPersisted($name, array $criterias)
{
$table = $this->convertNameToTable($this->singularize($name));
foreach ($criterias as $criteria) {
$criteria = $this->applyMapping($this->getFieldMapping($table), $criteria);
$this->transformFixture($table, $criteria);
$match = $this->find($table, $criteria);
Assert::assertNotEmpty($match, sprintf('There should not be a record in table "%s" with these criteria: %s', $table, json_encode($criteria)));
}
}
示例8: testSendRequest
public function testSendRequest()
{
if (!$this->CONNECTION_IS_SET) {
$this->markTestIncomplete("Authorization credentials must be defined as environment vars.");
}
$xcpd_client = new Client($this->CONNECTION_STRING, $this->RPC_USER, $this->RPC_PASSWORD);
$response_data = $xcpd_client->get_block_info(['block_index' => 312600]);
// echo json_encode($response_data, 192)."\n";
PHPUnit::assertNotEmpty($response_data);
PHPUnit::assertEquals('312600', $response_data['block_index']);
}
示例9: testCLIListUsers
public function testCLIListUsers()
{
$kernel = $this->app['Illuminate\\Contracts\\Console\\Kernel'];
// insert
$kernel->call('api:new-user', ['email' => 'samplecli@tokenly.co']);
// list
$kernel->call('api:list-users');
$output = $kernel->output();
PHPUnit::assertNotEmpty($output);
PHPUnit::assertContains('samplecli@tokenly.co', $output);
}
示例10: testFindByUUID
public function testFindByUUID()
{
// insert
$monitored_address_repo = $this->app->make('App\\Repositories\\MonitoredAddressRepository');
$monitored_address_helper = $this->app->make('\\MonitoredAddressHelper');
$created_address = $monitored_address_repo->create($monitored_address_helper->sampleDBVars(['address' => '1recipient111111111111111111111111']));
// load from repo
$loaded_address_model = $monitored_address_repo->findByUuid($created_address['uuid']);
PHPUnit::assertNotEmpty($loaded_address_model);
PHPUnit::assertEquals($created_address['id'], $loaded_address_model['id']);
PHPUnit::assertEquals($created_address['address'], $loaded_address_model['address']);
}
示例11: testParsePHP
public function testParsePHP()
{
$parser = new Parser();
$php_string = <<<'EOT'
$a = 5;
$c = $a + 2;
return $c;
EOT;
$stmts = $parser->parsePHPString($php_string);
PHPUnit::assertNotEmpty($stmts);
}
示例12: testUpdateByUUID
public function testUpdateByUUID()
{
// insert
$user_repo = $this->app->make('App\\Repositories\\UserRepository');
$created_user_model = $user_repo->create($this->app->make('\\UserHelper')->sampleDBVars());
// update
$user_repo->updateByUuid($created_user_model['uuid'], ['email' => 'sample2@tokenly.co']);
// load from repo again
$loaded_user_model = $user_repo->findByUuid($created_user_model['uuid']);
PHPUnit::assertNotEmpty($loaded_user_model);
PHPUnit::assertEquals('sample2@tokenly.co', $loaded_user_model['email']);
PHPUnit::assertEquals($created_user_model['password'], $loaded_user_model['password']);
}
示例13: processAssert
/**
* @param $orderId
* @param OrderIndex $orderIndex
* @param SalesOrderView $salesOrderView
* @param BraintreeSettlementReportIndex $braintreeSettlementReportIndex
* @throws \Exception
*/
public function processAssert($orderId, OrderIndex $orderIndex, SalesOrderView $salesOrderView, BraintreeSettlementReportIndex $braintreeSettlementReportIndex)
{
$this->salesOrderView = $salesOrderView;
$this->settlementReportIndex = $braintreeSettlementReportIndex;
$orderIndex->open();
$orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]);
$transactionId = $this->getTransactionId();
\PHPUnit_Framework_Assert::assertNotEmpty($transactionId);
$this->settlementReportIndex->open();
$grid = $this->settlementReportIndex->getSettlementReportGrid();
$grid->search(['id' => $transactionId]);
$ids = $grid->getTransactionIds();
\PHPUnit_Framework_Assert::assertTrue(in_array($transactionId, $ids));
}
示例14: iSelectPackage
/**
* @When I select :packageName package version :version
*/
public function iSelectPackage($packageName, $version)
{
$package = $this->packages[strtolower($packageName)];
Assertion::assertNotNull($package, "Package '{$packageName}' not defined");
// first select the package
$fields = $this->getXpath()->findFields($package);
Assertion::assertNotEmpty($fields, "Couldn't find '{$package}' field");
$fields[0]->check();
// now verify version
// IMPORTANT: only verify the values shown on the page, does not actually
// verify if the package is in a given version
$versionLabel = "{$packageName} (ver. {$version})";
$this->iSeeTitle($versionLabel);
}
示例15: testFindAllTransactionsConfirmedInBlockHashes
public function testFindAllTransactionsConfirmedInBlockHashes()
{
// insert
$created_transaction_models = [];
$created_transaction_models[] = $this->txHelper()->createSampleTransaction('sample_xcp_parsed_01.json', ['txid' => 'TX01', 'bitcoinTx' => ['blockhash' => 'BLOCKHASH01']]);
$created_transaction_models[] = $this->txHelper()->createSampleTransaction('sample_xcp_parsed_01.json', ['txid' => 'TX02', 'bitcoinTx' => ['blockhash' => 'BLOCKHASH02']]);
$created_transaction_models[] = $this->txHelper()->createSampleTransaction('sample_xcp_parsed_01.json', ['txid' => 'TX03', 'bitcoinTx' => ['blockhash' => 'BLOCKHASH03']]);
// load from repo
$tx_repo = $this->app->make('App\\Repositories\\TransactionRepository');
$loaded_transaction_models = $tx_repo->findAllTransactionsConfirmedInBlockHashes(['BLOCKHASH02', 'BLOCKHASH03']);
PHPUnit::assertNotEmpty($loaded_transaction_models);
PHPUnit::assertCount(2, $loaded_transaction_models);
PHPUnit::assertEquals('TX02', $loaded_transaction_models[0]['txid']);
PHPUnit::assertEquals('TX03', $loaded_transaction_models[1]['txid']);
}