Example #1
0
 public function testNearEventArgs()
 {
     $invoker = new \stdClass();
     $query = array('x' => 1);
     $near = array(10, 20);
     $options = array('limit' => 5);
     $nearEventArgs = new NearEventArgs($invoker, $query, $near, $options);
     $this->assertSame($invoker, $nearEventArgs->getInvoker());
     $this->assertSame($query, $nearEventArgs->getQuery());
     $this->assertSame($near, $nearEventArgs->getNear());
     $this->assertSame($options, $nearEventArgs->getOptions());
 }
Example #2
0
 public function testNearEventArgs()
 {
     $invoker = new \stdClass();
     $query = ['x' => 1];
     $near = [10, 20];
     $options = ['limit' => 5];
     $nearEventArgs = new NearEventArgs($invoker, $query, $near, $options);
     $this->assertSame($invoker, $nearEventArgs->getInvoker());
     $this->assertSame($query, $nearEventArgs->getQuery());
     $this->assertSame($near, $nearEventArgs->getNear());
     $this->assertSame($options, $nearEventArgs->getOptions());
     $query2 = ['x' => 2];
     $near2 = [20, 30];
     $options2 = ['limit' => 6];
     $nearEventArgs->setQuery($query2);
     $nearEventArgs->setNear($near2);
     $nearEventArgs->setOptions($options2);
     $this->assertSame($query2, $nearEventArgs->getQuery());
     $this->assertSame($near2, $nearEventArgs->getNear());
     $this->assertSame($options2, $nearEventArgs->getOptions());
 }
 public function collectionPreNear(NearEventArgs $args)
 {
     $args->setQuery($this->query);
     $args->setNear($this->near);
     $args->setOptions($this->options);
 }