/** * Test loading extensions from a file * * @return void * @author Dan Cox */ public function test_loadFromFile() { $register = new ExtensionRegister(); $register->clearExtensions(); $register->loadFromFile(__DIR__ . '/Extension/Extensions.php'); $this->assertContains('Wasp\\Test\\DI\\Extension\\TestExtension', $register->getExtensions()); }
/** * Tear down test class * * @return void * @author Dan Cox */ public function tearDown() { \Mockery::close(); // Clear the mocks $library = new ServiceMockeryLibrary(); $library->clear(); $extensions = new \Wasp\DI\ExtensionRegister(); $extensions->clearExtensions(); DICompilerPassRegister::clear(); }
/** * Registers extensions * * @return void * @author Dan Cox */ public function registerExtensions() { if (!is_null($this->extensions)) { $register = new ExtensionRegister(); $register->loadFromArray($this->extensions); } }
/** * Loads registered extensions if there are any * * @return void * @author Dan Cox */ public function loadExtensions() { $this->extensions->register(static::$container); }