Sokil\Mongo\CollectionTest::testOverrideDefaultDocumentClassByString PHP Method

testOverrideDefaultDocumentClassByString() public method

    public function testOverrideDefaultDocumentClassByString()
    {
        // define array of collections
        $this->database->map(array('collection1' => array('documentClass' => '\\Sokil\\Mongo\\CollectionTestDocumentMock')));
        // define collection
        $this->database->map('collection2', array('documentClass' => '\\Sokil\\Mongo\\CollectionTestDocumentMock'));
        // check
        $collection1 = $this->database->getCollection('collection1');
        $this->assertEquals('\\Sokil\\Mongo\\CollectionTestDocumentMock', $collection1->getDocumentClassName());
        $collection2 = $this->database->getCollection('collection2');
        $this->assertEquals('\\Sokil\\Mongo\\CollectionTestDocumentMock', $collection2->getDocumentClassName());
    }
CollectionTest