Sokil\Mongo\DocumentTest::testSetId_AsStringThatCanBeMongoIdClass PHP Method

testSetId_AsStringThatCanBeMongoIdClass() public method

    public function testSetId_AsStringThatCanBeMongoIdClass()
    {
        // save document
        $id = '541073e62de5725a2a8b4567';
        $doc = $this->collection->createDocument(array('a' => 'a'));
        $doc->setId($id);
        $doc->save();
        // find document
        $this->assertNotEmpty($this->collection->getDocument($id));
        // delete document
        $this->collection->deleteDocument($doc);
    }
DocumentTest