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


PHP MockInterface::shouldNotReceive方法代码示例

本文整理汇总了PHP中Mockery\MockInterface::shouldNotReceive方法的典型用法代码示例。如果您正苦于以下问题:PHP MockInterface::shouldNotReceive方法的具体用法?PHP MockInterface::shouldNotReceive怎么用?PHP MockInterface::shouldNotReceive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mockery\MockInterface的用法示例。


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

示例1: it_should_not_call_remove_from_indices_if_afterUpdate_is_set_to_false

 /** @test */
 public function it_should_not_call_remove_from_indices_if_afterUpdate_is_set_to_false()
 {
     $dummyModel = new DummyActiveRecordModel();
     $dummyModel->attachBehavior('test', ['class' => SynchronousAutoIndexBehavior::class, 'afterUpdate' => false]);
     $this->dummyAlgoliaManager->shouldNotReceive('updateInIndices');
     $dummyModel->trigger(ActiveRecord::EVENT_AFTER_UPDATE);
 }
开发者ID:lordthorzonus,项目名称:yii2-algolia,代码行数:8,代码来源:SynchronousAutoIndexBehaviorTest.php

示例2: it_discards_messages_that_where_captured_when_a_exception_occured

 /**
  * @test
  */
 public function it_discards_messages_that_where_captured_when_a_exception_occured()
 {
     $this->capturer->shouldReceive('clear')->withNoArgs()->once();
     $this->capturer->shouldNotReceive('fetchMessages');
     $this->setExpectedException(\RuntimeException::class, 'Failed');
     $this->middleware->execute('some_command', function () {
         throw new \RuntimeException('Failed');
     });
 }
开发者ID:boekkooi,项目名称:tactician-amqp,代码行数:12,代码来源:InMemoryMiddlewareTest.php

示例3: it_should_pass_trough_none_rpc_commands

 /**
  * @test
  */
 public function it_should_pass_trough_none_rpc_commands()
 {
     $this->transformer->shouldNotReceive('transformCommandResponse');
     $this->publisher->shouldNotReceive('publish');
     $envelope = Mockery::mock(\AMQPEnvelope::class);
     $envelope->shouldReceive('getReplyTo')->atLeast()->once()->andReturn('');
     $command = Mockery::mock(Command::class);
     $command->shouldReceive('getEnvelope')->atLeast()->once()->andReturn($envelope);
     $this->execute($this->middleware, $command, $command);
 }
开发者ID:boekkooi,项目名称:tactician-amqp,代码行数:13,代码来源:RemoteResponseMiddlewareTest.php

示例4: it_should_reject_a_envelope_when_there_is_a_exception

 /**
  * @test
  */
 public function it_should_reject_a_envelope_when_there_is_a_exception()
 {
     $middleware = new ConsumeMiddleware(false);
     $this->queue->shouldNotReceive('ack')->with('tag');
     $this->queue->shouldReceive('reject')->once()->with('tag', AMQP_NOPARAM);
     $this->envelope->shouldReceive('getDeliveryTag')->withNoArgs()->andReturn('tag');
     $this->setExpectedException(\RuntimeException::class, 'The queue should reject the message now');
     $middleware->execute($this->command, function () {
         throw new \RuntimeException('The queue should reject the message now');
     });
 }
开发者ID:boekkooi,项目名称:tactician-amqp,代码行数:14,代码来源:ConsumeMiddlewareTest.php

示例5: testDoNotProcessWhenTacticianDoctrineIsNotInstalled

 public function testDoNotProcessWhenTacticianDoctrineIsNotInstalled()
 {
     if (class_exists(TransactionMiddleware::class)) {
         $this->markTestSkipped('"league/tactician-doctrine" is installed');
     }
     $this->container->shouldReceive('hasParameter')->with('doctrine.entity_managers')->andReturn(true);
     $this->container->shouldNotReceive('getParameter')->withAnyArgs();
     $this->container->shouldNotReceive('setDefinition')->withAnyArgs();
     $this->container->shouldNotReceive('setAlias')->withAnyArgs();
     $this->compiler->process($this->container);
 }
开发者ID:nejcpenko,项目名称:tactician-bundle,代码行数:11,代码来源:DoctrineMiddlewarePassTest.php

示例6: testRolloverWithoutCourseObjectives

 public function testRolloverWithoutCourseObjectives()
 {
     $course = $this->createTestCourse();
     $course->setSchool(new School());
     $course->addObjective(new Objective());
     $newCourse = m::mock('Ilios\\CoreBundle\\Entity\\CourseInterface');
     $newCourse->shouldIgnoreMissing();
     $newCourse->shouldNotReceive('addObjective');
     $this->objectiveManager->shouldNotReceive('create');
     $newYear = $this->setupCourseManager($course, $newCourse);
     $this->service->rolloverCourse($course->getId(), $newYear, ['skip-course-objectives' => true]);
 }
开发者ID:stopfstedt,项目名称:ilios,代码行数:12,代码来源:CourseRolloverTest.php

示例7: it_should_continue_if_its_not_a_message

 /**
  * @test
  */
 public function it_should_continue_if_its_not_a_message()
 {
     $this->locator->shouldNotReceive('getPublisherForMessage');
     $command = new \stdClass();
     $this->execute($this->middleware, $command, $command);
 }
开发者ID:boekkooi,项目名称:tactician-amqp,代码行数:9,代码来源:PublishMiddlewareTest.php

示例8: it_should_pass_trough_unknown_commands

 /**
  * @test
  */
 public function it_should_pass_trough_unknown_commands()
 {
     $this->transformer->shouldNotReceive('transformCommandToMessage');
     $command = new \stdClass();
     $this->execute($this->middleware, $command, $command);
 }
开发者ID:boekkooi,项目名称:tactician-amqp,代码行数:9,代码来源:CommandTransformerMiddlewareTest.php

示例9: it_should_pass_trough_none_amqp_commands

 /**
  * @test
  */
 public function it_should_pass_trough_none_amqp_commands()
 {
     $this->transformer->shouldNotReceive('transformEnvelopeToCommand');
     $command = new \stdClass();
     $this->execute($this->middleware, $command, $command);
 }
开发者ID:boekkooi,项目名称:tactician-amqp,代码行数:9,代码来源:EnvelopeTransformerMiddlewareTest.php


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