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


PHP expect_not函数代码示例

本文整理汇总了PHP中expect_not函数的典型用法代码示例。如果您正苦于以下问题:PHP expect_not函数的具体用法?PHP expect_not怎么用?PHP expect_not使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: testHandlePassesToAggregate

 public function testHandlePassesToAggregate()
 {
     $command = $this->makeCommand();
     $this->subject->shouldReceive('getSequence')->withNoArgs()->once()->andReturn(30);
     $this->subject->shouldReceive('handle')->with($command)->once();
     expect_not(RepositoryStub::handle($command));
 }
开发者ID:C4Tech,项目名称:laravel-ray-emitter,代码行数:7,代码来源:RepositoryTest.php

示例2: testLoginCorrect

 public function testLoginCorrect()
 {
     $this->_model = new LoginForm(['email' => 'admin@example.org', 'password' => '123123']);
     expect_that($this->_model->login());
     expect_not(Yii::$app->user->isGuest);
     expect($this->_model->errors)->hasntKey('password');
 }
开发者ID:yii2mod,项目名称:base,代码行数:7,代码来源:LoginFormTest.php

示例3: testNotSendEmailsToInactiveUser

 public function testNotSendEmailsToInactiveUser()
 {
     $user = $this->tester->grabFixture('user', 1);
     $model = new PasswordResetRequestForm();
     $model->email = $user['email'];
     expect_not($model->sendEmail());
 }
开发者ID:yiisoft,项目名称:yii2-app-advanced,代码行数:7,代码来源:PasswordResetRequestFormTest.php

示例4: testIsSuperUser

 public function testIsSuperUser()
 {
     $authItem = new AuthItem();
     expect_not($authItem->isSuperUser());
     $authItem->name = User::ROLE_SUPERUSER;
     expect_that($authItem->isSuperUser());
 }
开发者ID:rkit,项目名称:bootstrap-yii2,代码行数:7,代码来源:AuthItemTest.php

示例5: testLoginCorrect

 public function testLoginCorrect()
 {
     $this->model = new LoginForm(['username' => 'demo', 'password' => 'demo']);
     expect_that($this->model->login());
     expect_not(\Yii::$app->user->isGuest);
     expect($this->model->errors)->hasntKey('password');
 }
开发者ID:chizdrel,项目名称:yii2-app-basic,代码行数:7,代码来源:LoginFormTest.php

示例6: testValidateUser

 /**
  * @depends testFindUserByUsername
  */
 public function testValidateUser($user)
 {
     $user = User::findByUsername('admin');
     expect_that($user->validateAuthKey('test100key'));
     expect_not($user->validateAuthKey('test102key'));
     expect_that($user->validatePassword('admin'));
     expect_not($user->validatePassword('123456'));
 }
开发者ID:chizdrel,项目名称:yii2-app-basic,代码行数:11,代码来源:UserTest.php

示例7: testNotCorrectSignup

 public function testNotCorrectSignup()
 {
     $model = new SignupForm(['username' => 'troy.becker', 'email' => 'nicolas.dianna@hotmail.com', 'password' => 'some_password']);
     expect_not($model->signup());
     expect_that($model->getErrors('username'));
     expect_that($model->getErrors('email'));
     expect($model->getFirstError('username'))->equals('This username has already been taken.');
     expect($model->getFirstError('email'))->equals('This email address has already been taken.');
 }
开发者ID:yiisoft,项目名称:yii2-app-advanced,代码行数:9,代码来源:SignupFormTest.php

示例8: testValidateUser

 /**
  * @depends testFindUserByUsername
  */
 public function testValidateUser()
 {
     /** @var User $user */
     $user = User::find()->where(['username' => 'neo'])->one();
     expect_that($user->validateAuthKey('neo'));
     expect_not($user->validateAuthKey('test102key'));
     //expect_that($user->validatePassword('neo'));
     //expect_not($user->validatePassword('123456'));
 }
开发者ID:amnah,项目名称:yii2-angular,代码行数:12,代码来源:User1Test.php

示例9: testRegister

 public function testRegister()
 {
     $this->provider->shouldReceive('mergeConfigFrom')->with(Mockery::type('string'), 'ray_emitter')->once();
     App::shouldReceive('singleton')->with('rayemitter.store', Mockery::on(function ($closure) {
         $result = $closure();
         expect_that($result);
         expect($result instanceof Store)->true();
         return true;
     }))->once();
     expect_not($this->provider->register());
 }
开发者ID:C4Tech,项目名称:laravel-ray-emitter,代码行数:11,代码来源:ServiceProviderTest.php

示例10: testSuccess

 public function testSuccess()
 {
     $user = User::findByEmail('superuser@example.com');
     expect_not($user->isConfirmed());
     $form = new ConfirmEmailForm();
     expect_that($form->validateToken($user->email_confirm_token));
     expect_that($form->confirmEmail());
     $user = User::findByEmail($user->email);
     expect($user->email_confirm_token)->isEmpty();
     expect_that($user->isConfirmed());
 }
开发者ID:rkit,项目名称:bootstrap-yii2,代码行数:11,代码来源:ConfirmEmailFormTest.php

示例11: testPublishQueue

 public function testPublishQueue()
 {
     $store = Mockery::mock(EventStore::class)->makePartial();
     $payload = [Mockery::mock('stdClass')];
     $event_name = 'testEvent';
     $event = ['event' => $event_name, 'payload' => $payload];
     EventBus::shouldReceive('fire')->with('publish:' . $event_name, $payload)->once();
     $this->setPropertyValue($store, 'queue', [$event]);
     expect_not($store->publishQueue());
     $queue = $this->getPropertyValue($store, 'queue');
     expect($queue)->equals([]);
 }
开发者ID:C4Tech,项目名称:laravel-ray-emitter,代码行数:12,代码来源:StoreTest.php

示例12: testCheckFakePermission

 public function testCheckFakePermission()
 {
     $config = Yii::getAlias('@app/tests/_data/rbac/permissions.php');
     $auth = Yii::$app->authManager;
     $permission = $auth->createPermission('test');
     $auth->add($permission);
     expect_that($auth->getPermission('test'));
     $command = new RbacController('test', 'test');
     $command->path = $config;
     $command->beforeAction('test');
     $command->actionUp();
     expect_not($auth->getPermission('test'));
 }
开发者ID:rkit,项目名称:bootstrap-yii2,代码行数:13,代码来源:RbacTest.php

示例13: testHandleRollsBack

 /**
  * @expectedException Exception
  */
 public function testHandleRollsBack()
 {
     $subject = new Middleware();
     $parameter = 'request';
     $callback = function ($request) use($parameter) {
         expect($request)->equals($parameter);
         throw new \Exception();
     };
     DB::shouldReceive('beginTransaction')->withNoArgs()->once();
     EventStore::shouldReceive('saveQueue')->withNoArgs()->never();
     DB::shouldReceive('rollBack')->withNoArgs()->once();
     DB::shouldReceive('commit')->withNoArgs()->never();
     expect_not($subject->handle($parameter, $callback));
 }
开发者ID:C4Tech,项目名称:laravel-ray-emitter,代码行数:17,代码来源:MiddlewareTest.php

示例14: testValidationIsSkipped

 public function testValidationIsSkipped()
 {
     $model = new Item05();
     $model->status = 'Item05Workflow/new';
     expect_that($model->save());
     expect_not($model->hasErrors());
     $this->specify('model validation is skipped if save is done with no validation', function () use($model) {
         $model->name = null;
         $model->status = 'Item05Workflow/correction';
         verify('save is successful when no validation is done', $model->save(false))->true();
         verify('the model has no errors', $model->hasErrors())->false();
         verify('the model status has changed', $model->getWorkflowStatus()->getId())->equals('Item05Workflow/correction');
         verify('the status attribute has changed', $model->status)->equals('Item05Workflow/correction');
     });
 }
开发者ID:heartshare,项目名称:yii2-workflow,代码行数:15,代码来源:ValidatorTest.php

示例15: testSuccess

 public function testSuccess()
 {
     $form = new SignupForm(['fullName' => 'Test', 'email' => 'test@test.com', 'password' => 'test_password']);
     $user = $form->signup();
     expect($user)->isInstanceOf('app\\models\\User');
     expect_not($user->isConfirmed());
     expect($user->email)->equals('test@test.com');
     expect_that($user->validatePassword('test_password'));
     expect_that($form->sendEmail());
     $user = User::findByEmail('test@test.com');
     expect($user->profile->full_name)->equals('Test');
     $message = $this->tester->grabLastSentEmail();
     expect('valid email is sent', $message)->isInstanceOf('yii\\mail\\MessageInterface');
     expect($message->getTo())->hasKey($user->email);
     expect($message->getFrom())->hasKey('editor@mail.com');
 }
开发者ID:rkit,项目名称:bootstrap-yii2,代码行数:16,代码来源:SignupFormTest.php


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