Ejemplo n.º 1
0
 /**
  * @group DDC-268
  */
 public function testColumnWithMissingTypeDefaultsToString()
 {
     $cm = new ClassMetadata('Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\ColumnWithoutType');
     $reader = new \Doctrine\Common\Annotations\AnnotationReader();
     $annotationDriver = new \Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver($reader);
     $annotationDriver->loadMetadataForClass('Doctrine\\ODM\\MongoDB\\Tests\\Mapping\\InvalidColumn', $cm);
     $this->assertEquals('id', $cm->fieldMappings['id']['type']);
 }
Ejemplo n.º 2
0
 public function testLoadPrefixedMetadata()
 {
     $metadata = $this->generateBookDocumentFixture();
     $book = $this->newInstance($metadata);
     $cm = new \Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo($metadata->name);
     $reader = new \Doctrine\Common\Annotations\AnnotationReader();
     $driver = new \Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver($reader);
     $driver->loadMetadataForClass($cm->name, $cm);
     $this->assertEquals($cm->getCollection(), $metadata->getCollection());
     $this->assertEquals($cm->lifecycleCallbacks, $metadata->lifecycleCallbacks);
     $this->assertEquals($cm->identifier, $metadata->identifier);
     $this->assertEquals($cm->idGenerator, $metadata->idGenerator);
     $this->assertEquals($cm->customRepositoryClassName, $metadata->customRepositoryClassName);
 }