/**
  * @covers ::canonicalizeName
  * @dataProvider canonicalizeNameProvider
  */
 public function testCanonicalizeName($name, $canonical_name)
 {
     $service = new \stdClass();
     $service->value = 'myvalue';
     $container = new ContainerBuilder();
     $container->set($canonical_name, $service);
     $bridge = new ZfExtensionManagerSfContainer();
     $bridge->setContainer($container);
     $this->assertTrue($bridge->has($name));
     $this->assertEquals($service, $bridge->get($name));
 }
예제 #2
0
 public function setUp()
 {
     parent::setUp();
     $container = new ContainerBuilder();
     $manager = new ZfExtensionManagerSfContainer('feed.reader.');
     foreach ($this->readerExtensions as $key => $class) {
         $container->set($key, new $class());
     }
     $manager->setContainer($container);
     $container->set('feed.bridge.reader', $manager);
     \Drupal::setContainer($container);
     $this->feedType = $this->getMock('Drupal\\feeds\\FeedTypeInterface');
     $configuration = ['feed_type' => $this->feedType];
     $this->parser = new SyndicationParser($configuration, 'syndication', []);
     $this->parser->setStringTranslation($this->getStringTranslationStub());
     $this->state = new State();
     $this->feed = $this->getMock('Drupal\\feeds\\FeedInterface');
     $this->feed->expects($this->any())->method('getType')->will($this->returnValue($this->feedType));
 }