Sokil\Mongo\PersistenceTest::testRemove PHP Method

testRemove() public method

public testRemove ( Sokil\Mongo\Persistence $persistence )
$persistence Sokil\Mongo\Persistence
    public function testRemove(Persistence $persistence)
    {
        $document = $this->collection->createDocument(array('param' => 'value'))->save();
        // add document
        $persistence->remove($document);
        // check if document in persistence
        $this->assertTrue($persistence->contains($document));
        // store to disk
        $persistence->flush();
        // check if document in persistence
        $this->assertFalse($persistence->contains($document));
        // check if document removed
        $this->assertEmpty($this->collection->find()->findOne());
    }