public function testMerge() { $this->object->addPath('tests', FIXTURES_ROOT); $this->object->addPath('tests', dirname($this->dir)); $collection = new PathCollection(array('tests' => array(FIXTURES_ROOT, $this->dir), 'another' => array($this->dir))); $this->object->merge($collection); $this->assertThat($this->object->getAll(), $this->equalTo(array(FIXTURES_ROOT, dirname($this->dir), $this->dir, $this->dir))); $this->assertThat($collection->getAll(), $this->equalTo(array(FIXTURES_ROOT, $this->dir, $this->dir))); }
/** * Template method for registering class loaders, nested packages and * configuring the dependency injection container * * @param IContainerBuilder $builder */ public function register(IContainerBuilder $builder, PathCollection $paths) { $this->classLoaders = $this->registerClassLoaders(); if (is_array($this->classLoaders)) { foreach ($this->classLoaders as $classLoader) { $classLoader->registerClassLoader(); } } else { $this->classLoaders = array(); } $newPaths = $this->registerPaths(); if (is_object($newPaths)) { $paths->merge($newPaths); } $this->registerWiring($builder); }