本文整理汇总了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);
}
示例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');
});
}
示例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);
}
示例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');
});
}
示例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);
}
示例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]);
}
示例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);
}
示例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);
}
示例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);
}