コード例 #1
0
ファイル: Serializer.php プロジェクト: narixx/zf2
 /**
  * Returns a default adapter plugin loader
  *
  * @return Zend\Loader\PluginLoader
  */
 protected static function _getDefaultAdapterLoader()
 {
     $loader = new PluginLoader();
     $loader->addPrefixPath('Zend\\Serializer\\Adapter\\', __DIR__ . '/Serializer/Adapter');
     return $loader;
 }
コード例 #2
0
ファイル: PluginLoaderTest.php プロジェクト: heiglandreas/zf2
 /**
  * @group ZF-9721
  */
 public function testRemovePrefixPathThrowsExceptionIfPathNotRegisteredInPrefix()
 {
     try {
         $loader = new PluginLoader(array('My\\Namespace\\' => 'My/Namespace/'));
         $loader->removePrefixPath('My\\Namespace\\', 'ZF9721');
         $this->fail();
     } catch (\Exception $e) {
         $this->assertType('Zend\\Loader\\PluginLoaderException', $e);
         $this->assertContains('Prefix My\\Namespace\\ / Path ZF9721', $e->getMessage());
     }
     $this->assertEquals(1, count($loader->getPaths('My\\Namespace\\')));
 }