public function testVisitsLocation() { $visitor = new Visitor(); $param = $this->getNestedCommand('query')->getParam('foo')->setSentAs('test'); $visitor->visit($this->command, $this->request, $param, '123'); $this->assertEquals('123', $this->request->getQuery()->get('test')); }
/** * @covers Guzzle\Service\Command\LocationVisitor\Request\QueryVisitor * @covers Guzzle\Service\Command\LocationVisitor\Request\AbstractRequestVisitor::resolveRecursively */ public function testRecursivelyBuildsQueryStrings() { $command = $this->getCommand('postField'); $request = $command->prepare(); $visitor = new Visitor(); $param = $this->getNestedCommand('query')->getParam('foo'); $visitor->visit($command, $request, $param->setSentAs('Foo'), $command['foo']); $visitor->after($command, $request); $this->assertEquals('?Foo[test][baz]=1&Foo[test][Jenga_Yall!]=HELLO&Foo[bar]=123', rawurldecode((string) $request->getQuery())); }