當前位置: 首頁>>代碼示例>>PHP>>正文


PHP verify函數代碼示例

本文整理匯總了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']);
 }
開發者ID:stefanhuber,項目名稱:Robo,代碼行數:7,代碼來源:PhpspecTest.php

示例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();
 }
開發者ID:Junyue,項目名稱:zidisha2,代碼行數:28,代碼來源:CurrencyServiceCest.php

示例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']);
 }
開發者ID:stefanhuber,項目名稱:Robo,代碼行數:7,代碼來源:PHPUnitTest.php

示例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();
     });
 }
開發者ID:impleri,項目名稱:laravel-toolbox,代碼行數:35,代碼來源:ProviderTest.php

示例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();
    }
}
開發者ID:romeosidvicious,項目名稱:MixWidget-Back-End,代碼行數:28,代碼來源:functions.php

示例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();
     });
 }
開發者ID:ilyar,項目名稱:dektrium-yii2-user,代碼行數:29,代碼來源:LoginFormTest.php

示例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;
 }
開發者ID:jimmybupt,項目名稱:woocommerce-pos,代碼行數:34,代碼來源:class-wc-pos-template.php

示例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)
 } //
開發者ID:jonphipps,項目名稱:Metadata-Registry,代碼行數:26,代碼來源:importTest.php

示例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');
 }
開發者ID:aldsdelram,項目名稱:PUPNLPWebsite,代碼行數:26,代碼來源:Users.php

示例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');
 }
開發者ID:zondor,項目名稱:Robo,代碼行數:7,代碼來源:ExecCest.php

示例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');
 }
開發者ID:stefanhuber,項目名稱:Robo,代碼行數:7,代碼來源:ComposerTest.php

示例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)));
     });
 }
開發者ID:fproject,項目名稱:workflowii,代碼行數:7,代碼來源:WorkflowTest.php

示例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']);
 }
開發者ID:jjok,項目名稱:Robo,代碼行數:7,代碼來源:AtoumTest.php

示例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");
 }
開發者ID:sliver,項目名稱:Robo,代碼行數:7,代碼來源:ParallelExecTest.php

示例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');
 }
開發者ID:sliver,項目名稱:Robo,代碼行數:7,代碼來源:SemVerTest.php


注:本文中的verify函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。