/** * @dataProvider provideProxiedExprMethods */ public function testProxiedExprMethods($method, array $args = []) { $expr = $this->getMockAggregationExpr(); $expr->expects($this->once())->method($method)->with(...$args); $stage = new GroupStub($this->getTestAggregationBuilder()); $stage->setQuery($expr); $this->assertSame($stage, $stage->{$method}(...$args)); }
/** * @dataProvider provideProxiedExprMethods */ public function testProxiedExprMethods($method, array $args = array()) { $expr = $this->getMockAggregationExpr(); $invocationMocker = $expr->expects($this->once())->method($method); call_user_func_array(array($invocationMocker, 'with'), $args); $stage = new GroupStub($this->getTestAggregationBuilder()); $stage->setQuery($expr); $this->assertSame($stage, call_user_func_array(array($stage, $method), $args)); }