public function __construct(BundleMetadata $bundleMetadata) { $this->mappingDocumentDirectory = sprintf('%s/Resources/config/doctrine/', $bundleMetadata->getBundle()->getPath()); $this->extendedMappingDocumentDirectory = sprintf('%s/Resources/config/doctrine/', $bundleMetadata->getExtendedDirectory()); $this->documentDirectory = sprintf('%s/Document', $bundleMetadata->getBundle()->getPath()); $this->extendedDocumentDirectory = sprintf('%s/Document', $bundleMetadata->getExtendedDirectory()); $this->extendedSerializerDirectory = sprintf('%s/Resources/config/serializer', $bundleMetadata->getExtendedDirectory()); }
public function testBundleMetadata() { $bundle = new \Sonata\AcmeBundle\SonataAcmeBundle(); $bundleMetadata = new BundleMetadata($bundle, array('application_dir' => 'app/Application')); $this->assertTrue($bundleMetadata->isExtendable()); $this->assertTrue($bundleMetadata->isValid()); $this->assertEquals('SonataAcmeBundle', $bundleMetadata->getName()); $this->assertEquals('Sonata', $bundleMetadata->getVendor()); $this->assertEquals('Sonata\\AcmeBundle', $bundleMetadata->getNamespace()); $this->assertEquals('app/Application/Sonata/AcmeBundle', $bundleMetadata->getExtendedDirectory()); $this->assertEquals('Application\\Sonata\\AcmeBundle', $bundleMetadata->getExtendedNamespace()); $this->assertInstanceOf('Sonata\\EasyExtendsBundle\\Bundle\\OrmMetadata', $bundleMetadata->getOrmMetadata()); $this->assertInstanceOf('Sonata\\EasyExtendsBundle\\Bundle\\OdmMetadata', $bundleMetadata->getOdmMetadata()); $this->assertSame($bundle, $bundleMetadata->getBundle()); }
/** * @param $bundleMetadata */ public function setConfigFolders(BundleMetadata $bundleMetadata) { $this->mappingConfigDirectory = sprintf('%s/Resources/config', $bundleMetadata->getBundle()->getPath()); $this->mappingSerializerDirectory = sprintf('%s/Resources/config/serializer', $bundleMetadata->getBundle()->getPath()); $this->extendedConfigDirectory = sprintf('%s/Resources/config', $bundleMetadata->getExtendedDirectory()); $this->extendedSerializerDirectory = sprintf('%s/Resources/config/serializer', $bundleMetadata->getExtendedDirectory()); }