/** * Class init. * * @param \SplPriorityQueue $paths * @param array $config */ public function __construct($paths = null, $config = array()) { $this->setPaths($paths); $this->config = new Registry($this->config); $this->config->load($config); }
/** * Load the public variables of the object into the default namespace. * * @param object $object The object holding the publics to load * * @return Registry Return this object to support chaining. * * @since 1.0 */ public function loadObject($object) { $this->registry->load($object); return $this; }
/** * Method to test loadObject(). * * @return void * * @covers Windwalker\Registry\Registry::load */ public function testLoadObject() { $registry = new Registry(); $registry->load((object) $this->getTestData()); $this->assertEquals($registry->get('olive'), 'peace'); $this->assertEquals($registry->get('pos1.sunflower'), 'love'); }