コード例 #1
0
 public function testModule()
 {
     /** @var \MOC\V\Core\AutoLoader\Component\Bridge\Bridge $MockBridge */
     $MockBridge = $this->getMockBuilder('MOC\\V\\Core\\AutoLoader\\Component\\Bridge\\Bridge')->getMock();
     $Vendor = new Vendor(new $MockBridge());
     $Module = new AutoLoader($Vendor);
     $this->assertInstanceOf('MOC\\V\\Core\\AutoLoader\\Component\\IVendorInterface', $Module->getVendorInterface());
     $this->assertInstanceOf('MOC\\V\\Core\\AutoLoader\\Component\\IVendorInterface', $Module->setBridgeInterface($MockBridge));
     $this->assertInstanceOf('MOC\\V\\Core\\AutoLoader\\Component\\IBridgeInterface', $Module->getBridgeInterface());
 }
コード例 #2
0
 /**
  * @param string $Namespace
  * @param string $Directory
  *
  * @return IBridgeInterface
  */
 public static function getUniversalNamespaceAutoLoader($Namespace, $Directory)
 {
     $Loader = new AutoLoader(new Vendor(new UniversalNamespace()));
     $Loader->getBridgeInterface()->addNamespaceDirectoryMapping(new NamespaceParameter($Namespace), new DirectoryParameter($Directory));
     $Loader->getBridgeInterface()->registerLoader();
     return $Loader->getBridgeInterface();
 }