public function testGetGridFSClassName_Classpath() { $this->database->resetMapping(); $this->database->map('\\Sokil\\Mongo'); $reflectionClass = new \ReflectionClass($this->database); $method = $reflectionClass->getMethod('getCollectionDefinition'); $method->setAccessible(true); $classDefinition1 = $method->invoke($this->database, 'carPhotosGridFS'); $classDefinition2 = $method->invoke($this->database, 'CarPhotosGridFS'); $this->assertEquals('\\Sokil\\Mongo\\CarPhotosGridFS', $classDefinition1->class); $this->assertEquals('\\Sokil\\Mongo\\CarPhotosGridFS', $classDefinition2->class); }
/** * @expectedException \Sokil\Mongo\Exception * @expectedExceptionMessage Wrong definition passed for collection acmeCollection */ public function testMap_InvalidDefinitionVariableType() { $this->database->resetMapping(); $this->database->map(array('acmeCollection' => 42)); $this->database->getCollection('collection'); }