當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。