/** * @covers Malwarebytes\ZendeskBundle\Service\ApiService::updateUser */ public function testUpdateUser() { $service = $this->apiService->setMethods(null)->getMock(); $userId = 123; $data = array('foo' => 'bar'); $preparedData = array('user' => $data); $response = array('response'); $this->zendesk->expects($this->once())->method('call')->with("/users/{$userId}", json_encode($preparedData), 'PUT')->will($this->returnValue($response)); $this->assertEquals($response, $service->setZendeskApi($this->zendesk)->updateUser($userId, $preparedData)); }