Return the object instance (Singleton)
public static getInstance ( ) : |
||
return | The object instance |
/** * Test the booting in the frontend. * * @return void */ public function testBootBackend() { $dispatcher = $this->mockEventDispatcher(array(MetaModelsEvents::SUBSYSTEM_BOOT, MetaModelsEvents::SUBSYSTEM_BOOT_BACKEND)); $environment = \Contao\Environment::getInstance(); $container = new MetaModelsServiceContainer(); $container->setEventDispatcher($dispatcher); $environment::set('script', 'contao/main.php'); $boot = $this->getMock('MetaModels\\Helper\\SubSystemBoot', array('getMode', 'metaModelsTablesPresent')); $boot->expects($this->any())->method('getMode')->will($this->returnValue('BE')); $boot->expects($this->any())->method('metaModelsTablesPresent')->will($this->returnValue(true)); $class = new \ReflectionClass($boot); $getMode = $class->getMethod('getMode'); $getMode->setAccessible(true); /** @var SubSystemBoot $boot */ $this->assertEquals('BE', $getMode->invoke($boot)); $boot->boot(new \Pimple(array('environment' => $environment, 'metamodels-service-container' => $container))); }