public function testMixedParams() { $this->operation->setUri('bar{?limit,fields}'); $this->operation->addParam(new Parameter(array('name' => 'limit', 'location' => 'uri', 'required' => false))); $this->operation->addParam(new Parameter(array('name' => 'fields', 'location' => 'uri', 'required' => true))); $this->command['fields'] = array('id', 'name'); $request = $this->serializer->prepare($this->command); $this->assertEquals('http://foo.com/baz/bar?fields=' . urlencode('id,name'), (string) $request->getUrl()); }
public function testCanRemoveParams() { $c = new Operation(array()); $c->addParam(new Parameter(array('name' => 'foo'))); $this->assertTrue($c->hasParam('foo')); $c->removeParam('foo'); $this->assertFalse($c->hasParam('foo')); }