Sokil\Mongo\DocumentTest::testGetNull PHP Method

testGetNull() public method

public testGetNull ( )
    public function testGetNull()
    {
        //save
        $document = $this->collection->createDocument(array('field1' => null, 'field2' => array('subfield' => null)))->save();
        // get document
        $document = $this->collection->getDocumentDirectly($document->getId());
        $this->assertTrue($document->has('field1'));
        $this->assertNull($document->get('field1'));
        $this->assertTrue($document->has('field2.subfield'));
        $this->assertNull($document->get('field1.subfield'));
    }
DocumentTest