/** * Test Prefixes */ public function testPrefixes() { $loader = new \Phalcon\Loader(); $this->assertException(array($loader, 'registerPrefixes'), array('not even a prefix'), 'Phalcon\\Loader\\Exception'); $this->assertException(array($loader, 'registerPrefixes'), array(array('prefix'), 'not a boolean'), 'Phalcon\\Loader\\Exception'); $this->assertEquals($loader->getPrefixes(), null); $this->assertEquals($loader->registerPrefixes(array('ThisIsAPrefix' => 'path/')), $loader); $this->assertEquals($loader->getPrefixes(), array('ThisIsAPrefix' => 'path/')); $loader->registerPrefixes(array('AnotherPrefix' => 'other/path/'), true); $this->assertEquals($loader->getPrefixes(), array('ThisIsAPrefix' => 'path/', 'AnotherPrefix' => 'other/path/')); $loader->registerPrefixes(array('MasterPrefix' => 'prefix/')); $this->assertEquals($loader->getPrefixes(), array('MasterPrefix' => 'prefix/')); $loader->registerPrefixes(array('AnotherMaster' => 'master/prefix/'), false); $this->assertEquals($loader->getPrefixes(), array('AnotherMaster' => 'master/prefix/')); }