• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP expect_not函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了expect_not函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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' => '[email protected]', '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' => '[email protected]', '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('[email protected]');
     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' => '[email protected]', 'password' => 'test_password']);
     $user = $form->signup();
     expect($user)->isInstanceOf('app\\models\\User');
     expect_not($user->isConfirmed());
     expect($user->email)->equals('[email protected]');
     expect_that($user->validatePassword('test_password'));
     expect_that($form->sendEmail());
     $user = User::findByEmail('[email protected]');
     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('[email protected]');
 }
开发者ID:rkit,项目名称:bootstrap-yii2,代码行数:16,代码来源:SignupFormTest.php


示例16: testStatusEqualsFails

 public function testStatusEqualsFails()
 {
     $item = new Item04();
     $item->sendToStatus('A');
     expect_not($item->statusEquals('B'));
     expect_not($item->statusEquals('Item04Workflow/B'));
     expect_not($item->statusEquals('NOTFOUND'));
     expect_not($item->statusEquals('Item04Workflow/NOTFOUND'));
     expect_not($item->statusEquals('NOTFOUND/NOTFOUND'));
     expect_not($item->statusEquals('invalid name'));
     expect_not($item->statusEquals(''));
     expect_not($item->statusEquals(null));
     $statusA = $item->getWorkflowStatus();
     $item->sendToStatus('B');
     verify($item->statusEquals('B'));
     expect_not($item->statusEquals($statusA));
 }
开发者ID:raoul2000,项目名称:yii2-workflow,代码行数:17,代码来源:StatusEqualsTest.php


示例17: testLeaveWorkflowOnDelete

 public function testLeaveWorkflowOnDelete()
 {
     $post = new Item06();
     $post->name = 'post name';
     $post->enterWorkflow();
     verify($post->save())->true();
     verify($post->getWorkflowStatus()->getId())->equals('Item06Workflow/new');
     Item06Behavior::$countLeaveWorkflow = 0;
     $post->canLeaveWorkflow(true);
     expect_that($post->delete());
     verify(Item06Behavior::$countLeaveWorkflow)->equals(1);
     $post = new Item06();
     $post->name = 'post name';
     $post->enterWorkflow();
     verify($post->save())->true();
     verify($post->getWorkflowStatus()->getId())->equals('Item06Workflow/new');
     $post->canLeaveWorkflow(false);
     // refuse leave workflow
     // Now, the handler attached to the beforeLeaveWorkflow Event (see Item06Behavior)
     // will invalidate the event and return false (preventing the DELETE operation)
     expect_not($post->delete());
 }
开发者ID:heartshare,项目名称:yii2-workflow,代码行数:22,代码来源:BehaviorEventHandlerTest.php


示例18: testBootClosure

 public function testBootClosure()
 {
     $tag = ['test-123'];
     $node = Mockery::mock('C4tech\\Support\\Contracts\\ModelInterface');
     $node->parent = Mockery::mock('C4tech\\Support\\Contracts\\ModelInterface[touch]');
     $node->parent->shouldReceive('touch')->withNoArgs()->once();
     $model = Mockery::mock('stdClass');
     $model->shouldReceive('moved')->with(Mockery::on(function ($method) use($node) {
         expect_not($method($node));
         return true;
     }))->once();
     $model->shouldReceive('saved')->with(Mockery::on(function ($method) use($node) {
         expect_not($method($node));
         return true;
     }))->once();
     $model->shouldReceive('deleted')->once();
     Config::shouldReceive('get')->with(null, null)->twice()->andReturn($model, null);
     Config::shouldReceive('get')->with('app.debug')->times(3)->andReturn(true);
     Log::shouldReceive('info')->with(Mockery::type('string'), Mockery::type('array'))->once();
     Log::shouldReceive('debug')->with(Mockery::type('string'), Mockery::type('array'))->twice();
     Cache::shouldReceive('tags->flush')->with($tag)->withNoArgs()->once();
     $this->repo->shouldReceive('make->getParentTags')->with($node)->withNoArgs()->andReturn($tag);
     expect_not($this->repo->boot());
 }
开发者ID:C4Tech,项目名称:laravel-nested-sets,代码行数:24,代码来源:RepositoryTest.php


示例19: testEmptyToken

 public function testEmptyToken()
 {
     $form = new ResetPasswordForm();
     expect_not($form->validateToken(''));
 }
开发者ID:rkit,项目名称:bootstrap-yii2,代码行数:5,代码来源:ResetPasswordFormTest.php


示例20: testHydrateLoops

 public function testHydrateLoops()
 {
     $event = Mockery::mock('C4tech\\RayEmitter\\Contracts\\Domain\\Event');
     $collection = Mockery::mock('C4tech\\RayEmitter\\Contracts\\Event\\Collection[each]');
     $collection->shouldReceive('each')->with(Mockery::on(function ($callback) use($event) {
         $callback($event);
         return true;
     }))->once();
     $subject = Mockery::mock('C4tech\\Test\\RayEmitter\\Domain\\AggregateStub[apply]')->shouldAllowMockingProtectedMethods();
     $subject->shouldReceive('apply')->with($event)->once();
     $original_sequence = $subject->getSequence();
     expect_not($subject->hydrate($collection));
     expect($subject->getSequence())->greaterThan($original_sequence);
 }
开发者ID:C4Tech,项目名称:laravel-ray-emitter,代码行数:14,代码来源:AggregateTest.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP expect_that函数代码示例发布时间:2022-05-15
下一篇:
PHP expect函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap