Alcaeus\MongoDbAdapter\Tests\Mongo\MongoCollectionTest::testRemoveSingle PHP Method

testRemoveSingle() public method

public testRemoveSingle ( )
    public function testRemoveSingle()
    {
        $document = ['change' => true, 'foo' => 'bar'];
        $this->getCollection()->insert($document);
        unset($document['_id']);
        $this->getCollection()->insert($document);
        unset($document['_id']);
        $this->getCollection()->insert($document);
        $expected = ['ok' => 1.0, 'n' => 1, 'err' => null, 'errmsg' => null];
        $result = $this->getCollection()->remove(['foo' => 'bar'], ['justOne' => true]);
        $this->assertSame($expected, $result);
        $this->assertSame(2, $this->getCheckDatabase()->selectCollection('test')->count());
    }
MongoCollectionTest