/**
  * 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());
 }
示例#2
0
 /**
  * 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();
 }
示例#3
0
 /**
  * Registers extensions
  *
  * @return void
  * @author Dan Cox
  */
 public function registerExtensions()
 {
     if (!is_null($this->extensions)) {
         $register = new ExtensionRegister();
         $register->loadFromArray($this->extensions);
     }
 }
示例#4
0
文件: DI.php 项目: antoligy/Framework
 /**
  * Loads registered extensions if there are any
  *
  * @return void
  * @author Dan Cox
  */
 public function loadExtensions()
 {
     $this->extensions->register(static::$container);
 }