shouldReceive('get')->with(EventDispatcherInterface::class)->andReturn(m::mock(EventDispatcherInterface::class)); $container->shouldReceive('get')->with(ConfigInterface::class)->andReturn(new Config([])); $container->shouldReceive('get')->with(MailManagerInterface::class)->andReturn(new MailManager($container)); ApplicationContext::setContainer($container);