本文整理汇总了PHP中PHPUnit_Framework_Assert::assertGreaterThan方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::assertGreaterThan方法的具体用法?PHP PHPUnit_Framework_Assert::assertGreaterThan怎么用?PHP PHPUnit_Framework_Assert::assertGreaterThan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Assert
的用法示例。
在下文中一共展示了PHPUnit_Framework_Assert::assertGreaterThan方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: it_can_return_its_id
/**
* @test
*/
public function it_can_return_its_id()
{
$conn = $this->factory->createConnection('localhost');
$channel = $this->factory->createChannel($conn);
Assert::assertInternalType('integer', $channel->getChannelId());
Assert::assertGreaterThan(0, $channel->getChannelId());
}
示例2: seeInDatabase
public function seeInDatabase($table, $criteria = array())
{
$res = $this->proceedSeeInDatabase($table, 'count(*)', $criteria);
\PHPUnit_Framework_Assert::assertGreaterThan(0, $res, 'No matching records found');
}
示例3: imagesAreSimilarInPercent
public function imagesAreSimilarInPercent($percent)
{
$similarity = ImageSimilarityJudge::judge($this->originalImage, $this->optimizedImage);
$percent = $percent / 100;
\PHPUnit_Framework_Assert::assertGreaterThan($percent, $similarity);
return $this;
}
示例4: listEntities
private function listEntities($entityType)
{
Debug::debug("List {$entityType}");
$response = $this->sendRequest("{$entityType}", null, 'GET');
PHPUnit_Framework_Assert::assertGreaterThan(0, count($response->data));
return $response;
}
示例5: toBeLessThanOrEqualTo
public function toBeLessThanOrEqualTo($expected)
{
if ($this->negate) {
a::assertGreaterThan($expected, $this->actual);
} else {
a::assertLessThanOrEqual($expected, $this->actual);
}
}
示例6: responseContainsOnlyUsersWithTheEmail
/**
* @Given /^response contains only the user with the email "([^"]*)"$/
*/
public function responseContainsOnlyUsersWithTheEmail($email)
{
$userList = $this->getResponseObject();
Assertion::assertGreaterThan(0, count($userList), 'UserList was expected to contain one user only');
foreach ($userList as $user) {
Assertion::assertInstanceOf('eZ\\Publish\\API\\Repository\\Values\\User\\User', $user, 'Non User found in the response');
Assertion::assertEquals($email, $user->email, "UserList was expected to contain only users with email '{$email}'");
}
}
示例7: testAPI
public function testAPI()
{
$api = new RippleAPI(new Connection());
$index = $api->currentLedgerIndex();
PHPUnit::assertNotNull($index);
PHPUnit::assertGreaterThan(6000000, $index);
$index = $api->currentLedgerIndex();
PHPUnit::assertNotNull($index);
PHPUnit::assertGreaterThan(6000000, $index);
}
示例8: testCLIAddUser
public function testCLIAddUser()
{
// insert
$this->app['Illuminate\\Contracts\\Console\\Kernel']->call('api:new-user', ['email' => 'samplecli@tokenly.co']);
// load from repo
$user_repo = $this->app->make('App\\Repositories\\UserRepository');
$loaded_user_model = $user_repo->findByEmail('samplecli@tokenly.co');
PHPUnit::assertNotEmpty($loaded_user_model);
PHPUnit::assertGreaterThan(0, $loaded_user_model['id']);
PHPUnit::assertEquals('samplecli@tokenly.co', $loaded_user_model['email']);
}
示例9: tryList
public function tryList(FunctionalTester $I)
{
$I->wantTo("Check module list output");
$this->routeMatch->setParam('action', 'show');
$result = $this->controller->dispatch(new ConsoleRequest(array(0 => 'public/index.php', 1 => 'modules', 2 => 'list')));
/** @var Zend\Http\PhpEnvironment\Response $response */
$response = $this->controller->getResponse();
\PHPUnit_Framework_Assert::assertEquals(200, $response->getStatusCode());
\PHPUnit_Framework_Assert::assertEquals('', $result);
\PHPUnit_Framework_Assert::assertInstanceOf('ComposerLockParser\\PackagesCollection', $this->viewModel->getPackages());
\PHPUnit_Framework_Assert::assertGreaterThan(0, $this->viewModel->getPackages()->count());
\PHPUnit_Framework_Assert::assertInstanceOf('ComposerLockParser\\Package', $this->viewModel->getPackages()->getByName('t4web/modules'));
}
示例10: testAddBTCTransaction
public function testAddBTCTransaction()
{
// insert
$transaction_model = $this->txHelper()->createSampleTransaction('sample_btc_parsed_01.json');
$parsed_tx = $transaction_model['parsed_tx'];
// load from repo
$tx_repo = $this->app->make('App\\Repositories\\TransactionRepository');
$loaded_transaction_model = $tx_repo->findByTXID($parsed_tx['txid']);
PHPUnit::assertNotEmpty($loaded_transaction_model);
PHPUnit::assertEquals($parsed_tx['txid'], $loaded_transaction_model['txid']);
PHPUnit::assertEquals(0, $loaded_transaction_model['is_mempool']);
PHPUnit::assertEquals('00000000000000003a1e5abc2d7af7f38a614d2fcbafe309b7e8aa147d508a9c', $loaded_transaction_model['block_confirmed_hash']);
PHPUnit::assertGreaterThan(0, $loaded_transaction_model['id']);
}
示例11: testBitstampDriver
public function testBitstampDriver()
{
$client = $this->getQuoteClient();
$quotes = $client->getQuotes('bitstamp', [['base' => 'USD', 'target' => 'BTC']]);
if (getenv('ECHO_QUOTES')) {
echo "\$quotes:\n" . json_encode($quotes, 192) . "\n";
}
PHPUnit::assertInstanceOf('Tokenly\\CryptoQuoteClient\\Quote', $quotes[0]);
PHPUnit::assertGreaterThan(100, $quotes[0]['bid']);
PHPUnit::assertGreaterThan(100, $quotes[0]['ask']);
PHPUnit::assertGreaterThan(100, $quotes[0]['last']);
$quote = $client->getQuote('bitstamp', 'USD', 'BTC');
if (getenv('ECHO_QUOTES')) {
echo "\$quote:\n" . json_encode($quote, 192) . "\n";
}
PHPUnit::assertGreaterThan(100, $quote['bid']);
PHPUnit::assertGreaterThan(100, $quote['ask']);
PHPUnit::assertGreaterThan(100, $quote['last']);
}
示例12: testAllScenarios
public function testAllScenarios()
{
$starting_scenario_number = getenv('SCENARIO');
if (!$starting_scenario_number) {
$starting_scenario_number = 1;
}
// do all state tests in directory
$scenario_number_count = count(glob(base_path() . '/tests/fixtures/scenarios/*.yml'));
PHPUnit::assertGreaterThan(0, $scenario_number_count);
for ($i = $starting_scenario_number; $i <= $scenario_number_count; $i++) {
Log::debug("\n" . str_repeat('-', 60) . "\nBEGIN SCENARIO: {$i}\n" . str_repeat('-', 60));
// clear the db
if ($i > 1) {
$this->resetForScenario();
}
try {
$this->runScenario($i);
} catch (Exception $e) {
echo "\nFailed while running scenario {$i}\n";
throw $e;
}
}
}
示例13: setupBeforeClass
public static function setupBeforeClass()
{
parent::setUpBeforeClass();
if (!file_exists(_PS_MODULE_DIR_ . '/prestafraud/prestafraud.php')) {
$download = file_put_contents(_PS_CACHE_DIR_ . 'sandbox/prestafraud.zip', Tools::addonsRequest('module', array('id_module' => 4181)));
Assert::assertGreaterThan(20000, $download, 'Fail download module from Addons');
$extract = Tools::ZipExtract(_PS_CACHE_DIR_ . 'sandbox/prestafraud.zip', _PS_MODULE_DIR_);
Assert::assertTrue($extract, 'Fail extract module');
unlink(_PS_CACHE_DIR_ . 'sandbox/prestafraud.zip');
}
self::$prestafraud = Module::getInstanceByName('prestafraud');
Assert::assertTrue(is_object(self::$prestafraud), 'Fail Module::getInstanceByName(\'prestafraud\')');
Assert::assertEquals('prestafraud', self::$prestafraud->name);
if (!Module::isInstalled('prestafraud')) {
Assert::assertTrue((bool) self::$prestafraud->install());
}
Assert::assertTrue((bool) self::$prestafraud->isRegisteredInHook('actionValidateOrder'), 'Fail Module::isRegisteredInHook(\'actionValidateOrder\')');
$uniqid = uniqid() . time();
$email = 'prestabot+' . $uniqid . '@gmail.com';
$shop_url = 'http://www.prestashop-unit-test-' . $uniqid . '.com/';
$result = self::$prestafraud->_createAccount($email, $shop_url);
Assert::assertTrue($result, implode(', ', self::$prestafraud->_errors));
}
示例14: iShouldHaveAListOfPosts
/**
* @Then /^I should have a list of posts$/
*/
public function iShouldHaveAListOfPosts()
{
Assert::assertGreaterThan(0, count(self::$categoryPosts));
}
示例15: seeInDatabaseCollection
/**
* Checks if collection contains an item.
*
* ``` php
* <?php
* $I->seeInDatabaseCollection('database', 'users', array('name' => 'miles'));
* ```
*
* @param $database
* @param $collection
* @param array $criteria
*/
public function seeInDatabaseCollection($database, $collection, $criteria = array())
{
$this->checkDatabase($database);
$collection = $this->drivers[$database]->getDbh()->selectCollection($collection);
$res = $collection->count($criteria);
\PHPUnit_Framework_Assert::assertGreaterThan(0, $res);
}