/** * 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; }
/** * @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\\'))); }