/** * @covers Shutterstock\Presto\Presto::arrayToUrlParams */ public function testNestedURLParamBuildCustomDelimiter() { $this->assertEquals('foo=bar|foo=test', Presto::arrayToUrlParams(array('foo' => array('bar', 'test')), '|')); }
/** * @covers Shutterstock\Presto\Presto::custom */ public function testCustomRequest() { $response = (new Presto())->custom('PATCH', self::$TEST_ENDPOINT . 'patch', $this->getGenericData(), function (Response $response) { $data = $response->data; $data = json_decode($data, true); return $data['form']; }); $this->assertEquals($this->getGenericData(), $response); $response = (new Presto())->custom('PATCH', self::$TEST_ENDPOINT . 'patch', Presto::arrayToUrlParams($this->getGenericData()), function (Response $response) { $data = $response->data; $data = json_decode($data, true); return $data['form']; }); $this->assertEquals($this->getGenericData(), $response); }