Ejemplo n.º 1
0
 public function testGetExtensions()
 {
     $factory = new Factory();
     $factory->removeExtension('core')->removeExtension('data')->removeExtension('label')->removeExtension('actions')->register(new NamedExtension('e1'), 3)->register(new NamedExtension('e4'), 1)->register(new NamedExtension('e2'), 3)->register(new NamedExtension('e3'), 2);
     $method = new \ReflectionMethod($factory, 'getExtensions');
     $method->setAccessible(true);
     $extensions = $method->invoke($factory);
     $names = array_map(function (ExtensionInterface $extension) {
         return $extension->getName();
     }, $extensions);
     $this->assertEquals(array('e1', 'e2', 'e3', 'e4'), $names);
 }
Ejemplo n.º 2
0
 private function getFactory()
 {
     $factory = new Factory();
     return $factory->removeExtension('label')->removeExtension('actions');
 }