locator = $this->getMockForAbstractClass(ServiceLocatorInterface::class); $this->object = new ObjectManagerProvider($this->locator, new Bootstrap()); $this->locator->expects($this->any()) ->method('get') ->willReturnMap( [ [InitParamListener::BOOTSTRAP_PARAM, []], [Application::class, $this->getMockForAbstractClass(Application::class)], ] ); } /** * Tests the same instance of ObjectManagerInterface should be provided by the ObjectManagerProvider */ public function testGet() { $objectManager = $this->object->get(); $this->assertInstanceOf(ObjectManagerInterface::class, $objectManager); $this->assertSame($objectManager, $this->object->get()); } }