Esempio n. 1
0
 public function testGroupEventArgs()
 {
     $invoker = new \stdClass();
     $keys = 'x';
     $initial = array('count' => 0);
     $reduce = new \MongoCode('');
     $options = array('finalize' => new \MongoCode(''));
     $groupEventArgs = new GroupEventArgs($invoker, $keys, $initial, $reduce, $options);
     $this->assertSame($invoker, $groupEventArgs->getInvoker());
     $this->assertSame($keys, $groupEventArgs->getKeys());
     $this->assertSame($initial, $groupEventArgs->getInitial());
     $this->assertSame($reduce, $groupEventArgs->getReduce());
     $this->assertSame($options, $groupEventArgs->getOptions());
 }
 public function collectionPreGroup(GroupEventArgs $args)
 {
     $args->setKeys($this->keys);
     $args->setInitial($this->initial);
     $args->setReduce($this->reduce);
     $args->setOptions($this->options);
 }