Sokil\Mongo\Collection::getDatabase PHP Méthode

getDatabase() public méthode

public getDatabase ( ) : Database
Résultat Database
    public function getDatabase()
    {
        return $this->database;
    }

Usage Example

 public function testOnAfterConstruct()
 {
     $collectionMock = $this->getMock('\\Sokil\\Mongo\\Collection', array('getDocumentClassName'), array($this->collection->getDatabase(), 'phpmongo_test_collection'));
     $collectionMock->expects($this->once())->method('getDocumentClassName')->will($this->returnValue('\\Sokil\\Mongo\\DocumentWithAfterConstructEvent'));
     $document = $collectionMock->createDocument();
     $this->assertEquals(true, $document->status);
 }
All Usage Examples Of Sokil\Mongo\Collection::getDatabase