Sokil\Mongo\CollectionTest::testUpdate_UpdateDataIsOperatorCallable PHP Method

testUpdate_UpdateDataIsOperatorCallable() public method

    public function testUpdate_UpdateDataIsOperatorCallable()
    {
        // create documents
        $this->collection->createDocument(array('p' => 1))->save();
        $this->collection->update(array(), function (Operator $o) {
            $o->set('k', 'v');
        });
        // test
        $data = $this->collection->find()->findOne()->toArray();
        unset($data['_id']);
        $this->assertEquals(array('p' => 1, 'k' => 'v'), $data);
    }
CollectionTest