本文整理汇总了PHP中verify函数的典型用法代码示例。如果您正苦于以下问题:PHP verify函数的具体用法?PHP verify怎么用?PHP verify使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了verify函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPHPSpecCommand
public function testPHPSpecCommand()
{
$task = $this->taskPhpspec('phpspec')->stopOnFail()->noCodeGeneration()->quiet()->verbose('vv')->noAnsi()->noInteraction()->format('pretty');
verify($task->getCommand())->equals('phpspec run --stop-on-failure --no-code-generation --quiet -vv --no-ansi --no-interaction --format pretty');
$task->run();
$this->phpspec->verifyInvoked('executeCommand', ['phpspec run --stop-on-failure --no-code-generation --quiet -vv --no-ansi --no-interaction --format pretty']);
}
示例2: testConvertCurrency
public function testConvertCurrency(UnitTester $I)
{
$exchangeRate = new \Zidisha\Currency\ExchangeRate();
$exchangeRate->setRate(80)->setCurrencyCode(Currency::CODE_KES);
// convert to USD
$money = Money::create('160', Currency::CODE_KES);
$moneyUSD = Money::create('2.0', Currency::CODE_USD);
verify($this->currencyService->convertToUSD($money, $exchangeRate))->equals($moneyUSD);
// convert from USD
$money = Money::create('240', Currency::CODE_KES);
$moneyUSD = Money::create('3.0', Currency::CODE_USD);
verify($this->currencyService->convertFromUSD($moneyUSD, Currency::create(Currency::CODE_KES), $exchangeRate))->equals($money);
$failed = false;
try {
$money = Money::create('160', Currency::CODE_XOF);
$this->currencyService->convertToUSD($money, $exchangeRate);
} catch (\Zidisha\Currency\Exception\InvalidCurrencyExchangeException $e) {
$failed = true;
}
verify($failed)->true();
$failed = false;
try {
$this->currencyService->convertFromUSD($moneyUSD, Currency::create(Currency::CODE_XOF), $exchangeRate);
} catch (\Zidisha\Currency\Exception\InvalidCurrencyExchangeException $e) {
$failed = true;
}
verify($failed)->true();
}
示例3: testPHPUnitCommand
public function testPHPUnitCommand()
{
$task = $this->taskPHPUnit('phpunit')->bootstrap('bootstrap.php')->filter('Model')->group('important')->xml('result.xml')->debug();
verify($task->getCommand())->equals('phpunit --bootstrap bootstrap.php --filter Model --group important --log-junit result.xml --debug');
$task->run();
$this->phpunit->verifyInvoked('executeCommand', ['phpunit --bootstrap bootstrap.php --filter Model --group important --log-junit result.xml --debug']);
}
示例4: testCommands
/**
* Do the Artisan commands fire?
*/
public function testCommands()
{
$self = $this;
$this->prepareSpecify();
$this->specify('Boots', function () use($self) {
$target = $self->getProvider(['package']);
$target->shouldReceive('package');
$target->boot();
});
$this->prepareSpecify();
$this->specify('Identifies provisions', function () use($self) {
$target = $self->getProvider();
verify($target->provides())->notEmpty();
});
$this->prepareSpecify();
$this->specify('Binds to application', function () use($self) {
App::shouldReceive('bind')->with('/^toolbox\\.commands\\./', Mockery::on(function ($closure) {
$command = $closure();
verify_that('is a command', is_a($command, 'Illuminate\\Console\\Command'));
return true;
}));
Event::shouldReceive('listen')->with('toolbox.build', Mockery::on(function ($closure) {
$app = Mockery::mock('Illuminate\\Console\\Application[call]');
$app->shouldReceive('call');
$command = $closure($app);
return true;
}));
$target = $self->getProvider(['commands']);
$target->shouldReceive('commands')->with(Mockery::type('array'));
$target->register();
});
}
示例5: nav
function nav()
{
unset($_SESSION['index_class']);
unset($_SESSION['editmix_class']);
unset($_SESSION['validate_class']);
unset($_SESSION['makemix_class']);
unset($_SESSION['mwbedocs_class']);
unset($_SESSION['upfiles_class']);
if ($_SESSION['action'] == "index") {
index();
} elseif ($_SESSION['action'] == "makemix") {
makemix();
} elseif ($_SESSION['action'] == "upfiles") {
upfiles();
} elseif ($_SESSION['action'] == "verify") {
verify();
} elseif ($_SESSION['action'] == "validate") {
validate();
} elseif ($_SESSION['action'] == "editmix") {
editmix();
} elseif ($_SESSION['action'] == "mwbedocs") {
mwbedocs();
} elseif ($_SESSION['action'] == "delmix") {
delmix();
} else {
index();
}
}
示例6: testLogin
public function testLogin()
{
$this->form = new LoginForm();
$this->specify('should not allow logging in blocked users', function () {
$user = $this->getFixture('user')->getModel('blocked');
$this->form->setAttributes(['login' => $user->email, 'password' => 'qwerty']);
verify($this->form->validate())->false();
verify($this->form->getErrors('login'))->contains('Your account has been blocked');
});
$this->specify('should not allow logging in unconfirmed users', function () {
\Yii::$app->getModule('user')->enableConfirmation = true;
\Yii::$app->getModule('user')->enableUnconfirmedLogin = false;
$user = $this->getFixture('user')->getModel('user');
$this->form->setAttributes(['login' => $user->email, 'password' => 'qwerty']);
verify($this->form->validate())->true();
$user = $this->getFixture('user')->getModel('unconfirmed');
$this->form->setAttributes(['login' => $user->email, 'password' => 'unconfirmed']);
verify($this->form->validate())->false();
\Yii::$app->getModule('user')->enableUnconfirmedLogin = true;
verify($this->form->validate())->true();
});
$this->specify('should log the user in with correct credentials', function () {
$user = $this->getFixture('user')->getModel('user');
$this->form->setAttributes(['login' => $user->email, 'password' => 'wrong']);
verify($this->form->validate())->false();
$this->form->setAttributes(['login' => $user->email, 'password' => 'qwerty']);
verify($this->form->validate())->true();
});
}
示例7: template_redirect
/**
* Output the POS template
*/
public function template_redirect()
{
// check is pos
if (!is_pos('template')) {
return;
}
// check auth
if (!is_user_logged_in()) {
add_filter('login_url', array($this, 'login_url'));
auth_redirect();
}
//check store table
if (verify() == -1) {
wp_die(__('You are not listed as a store employee or administrator.'));
}
// check privileges
if (!current_user_can('access_woocommerce_pos')) {
/* translators: wordpress */
wp_die(__('You do not have sufficient permissions to access this page.'));
}
// disable cache plugins
$this->no_cache();
// last chance before template is rendered
do_action('woocommerce_pos_template_redirect');
// add head & footer actions
add_action('woocommerce_pos_head', array($this, 'head'));
add_action('woocommerce_pos_footer', array($this, 'footer'));
// now show the page
include 'views/template.php';
exit;
}
示例8: testProcessProlog
public function testProcessProlog()
{
$I = $this->tester;
$this->tester->wantToTest("processing the prolog and importing the file into the database");
$this->import->setCsvReader($this->import->file);
$this->import->processProlog();
$prolog = $this->import->prolog;
$this->assertEquals(14, count($prolog['columns']), "There are the correct number of columns");
$this->assertEquals(6, count($prolog['prefix']), "There are the correct number of prefix entries");
$this->assertEquals(10, count($prolog['meta']), "There are the correct number of meta entries");
$this->import->getDataColumnIds();
$this->import->processData();
$results = $this->import->results['success'];
verify(
"There were 8 rows processed",
count($results['rows'])
)->equals(12);
$this->import->processParents();
$I->seeRecordCountInDatabaseTable("SchemaPropertyElement", 138);
$I->seeRecordCountInDatabaseTable("SchemaProperty", 12);
//prolog namespace entries are readable
//prolog headers are actually in row 1
//prolog headers not in row 1 produce fatal error (logged)
//prolog entries can be matched to database (column uri matched to profile id)
//prolog entries that can't be matched produce fatal error (logged)
} //
示例9: login
public function login()
{
check_if_already_logged_in();
$data['page'] = "login";
$data['newline'] = "<br/>";
if (isset($_POST['btnLogin'])) {
$username = $_POST["username"];
$password = $_POST["password"];
if ($user_info = $this->Users_model->find($username)) {
$user_data = $this->Users_model->find_info($user_info['id']);
if (verify($password, $user_info["password"], $user_info["salt"])) {
$v = $this->Users_model->validity($user_info['id']);
$newdata = array('id' => $user_info['id'], 'username' => $username, 'type' => $user_info['type'], 'validity' => $v['validity'], 'user_info' => $user_data);
$this->session->set_userdata($newdata);
header('Location: home');
} else {
echo "false";
}
} else {
echo "Check your password or username";
}
}
$this->load->view('templates/header');
$this->load->view('users/login', $data);
$this->load->view('templates/footer');
}
示例10: toExecLsCommand
public function toExecLsCommand(CliGuy $I)
{
$command = strncasecmp(PHP_OS, 'WIN', 3) == 0 ? 'dir' : 'ls';
$res = $I->taskExec($command)->run();
verify($res->getMessage())->contains('src');
verify($res->getMessage())->contains('codeception.yml');
}
示例11: testComposerDumpAutoloadCommand
public function testComposerDumpAutoloadCommand()
{
verify($this->taskComposerDumpAutoload('composer')->getCommand())->equals('composer dump-autoload');
verify($this->taskComposerDumpAutoload('composer')->noDev()->getCommand())->equals('composer dump-autoload --no-dev');
verify($this->taskComposerDumpAutoload('composer')->optimize()->getCommand())->equals('composer dump-autoload --optimize');
verify($this->taskComposerDumpAutoload('composer')->optimize()->noDev()->getCommand())->equals('composer dump-autoload --optimize --no-dev');
}
示例12: testWorkflowCached
public function testWorkflowCached()
{
$this->factory->addWorkflowDefinition('wid', ['initialStatusId' => 'A', 'status' => ['A']]);
$this->specify('workflow are loaded once', function () {
verify('workflow instances are the same', spl_object_hash($this->factory->getWorkflow('wid', null)))->equals(spl_object_hash($this->factory->getWorkflow('wid', null)));
});
}
示例13: testAtoumCommand
public function testAtoumCommand()
{
$task = (new \Robo\Task\Testing\Atoum('atoum'))->bootstrap('bootstrap.php')->tags("needDb")->lightReport()->tap()->bootstrap('tests/bootstrap.php')->configFile("config/dev.php")->debug()->files(array("path/to/file1.php", "path/to/file2.php"))->directories("tests/units");
verify($task->getCommand())->equals('atoum --bootstrap bootstrap.php --tags needDb --use-light-report --use-tap-report --bootstrap tests/bootstrap.php -c config/dev.php --debug --f path/to/file1.php --f path/to/file2.php --directories tests/units');
$task->run();
$this->atoum->verifyInvoked('executeCommand', ['atoum --bootstrap bootstrap.php --tags needDb --use-light-report --use-tap-report --bootstrap tests/bootstrap.php -c config/dev.php --debug --f path/to/file1.php --f path/to/file2.php --directories tests/units']);
}
示例14: testParallelExec
public function testParallelExec()
{
$result = $this->taskParallelExec()->process('ls 1')->process('ls 2')->process('ls 3')->run();
$this->process->verifyInvokedMultipleTimes('start', 3);
verify($result->getExitCode())->equals(0);
$this->guy->seeInOutput("3 processes ended in 0.00 s");
}
示例15: testSemver
public function testSemver()
{
$semver = test::double('Robo\\Task\\SemVerTask', ['dump' => null]);
$res = $this->taskSemVer()->increment('major')->prerelease('RC')->increment('patch')->run();
verify($res->getMessage())->equals('v1.0.1-RC.1');
$semver->verifyInvoked('dump');
}