/** * Test for getBundleMapping(). Make sure meta fields are excluded from mapping. */ public function testGetBundleMapping() { $mapping = $this->metadataCollector->getBundleMapping('AcmeBarBundle'); $properties = $mapping['product']['properties']; $this->assertArrayNotHasKey('_id', $properties); $this->assertArrayNotHasKey('_ttl', $properties); $aliases = $mapping['product']['aliases']; $this->assertArrayHasKey('_id', $aliases); $this->assertArrayHasKey('_ttl', $aliases); }
/** * Test mapping getter when there are no bundles loaded from parser. * * @expectedException \LogicException * @expectedExceptionMessage Bundle 'acme' does not exist. */ public function testGetBundleMappingWithNoBundlesLoaded() { $this->metadataCollector->getBundleMapping('acme'); }
/** * Test bundle mapping parser when requesting non string bundle name. * * @expectedException \LogicException * @expectedExceptionMessage getBundleMapping() in the Metadata collector expects a string argument only! */ public function testGetBundleMappingWithNotStringName() { $this->metadataCollector->getBundleMapping(1000); }