addExtension() публичный Метод

TODO: Using "all" here is not a good idea. This means that nobody can create a structureType called "all"
public addExtension ( Sulu\Component\Content\Extension\ExtensionInterface $extension, $structureType = 'all' )
$extension Sulu\Component\Content\Extension\ExtensionInterface
Пример #1
0
 public function setUp()
 {
     $this->initPhpcr();
     $this->extensions = [new TestExtension('test1'), new TestExtension('test2', 'test2')];
     $this->mapper = $this->getContainer()->get('sulu.content.mapper');
     $this->documentManager = $this->getContainer()->get('sulu_document_manager.document_manager');
     $this->session = $this->getContainer()->get('doctrine_phpcr.default_session');
     $this->extensionManager = $this->getContainer()->get('sulu_content.extension.manager');
     $this->contentTypeManager = $this->getContainer()->get('sulu.content.type_manager');
     $this->tokenStorage = $this->getContainer()->get('security.token_storage');
     $token = $this->createUserTokenWithId(1);
     $this->tokenStorage->setToken($token);
     foreach ($this->extensions as $extension) {
         $this->extensionManager->addExtension($extension);
     }
 }
Пример #2
0
 /**
  * It should add extensions.
  */
 public function testAddExtension()
 {
     $this->extensionManager->addExtension($this->extension->reveal(), 'content')->shouldBeCalled();
     $this->structureManager->addExtension($this->extension->reveal(), 'content');
 }