Skip to content

Commit

Permalink
Send a valid payload in test
Browse files Browse the repository at this point in the history
It started failing in a new PHP version, as the endpoint
expects a XML object to parse. Send a payload without session
to check that the user is not logged in.
  • Loading branch information
anarute committed Sep 27, 2023
1 parent ec8a8da commit d948653
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/integration/TaskServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ public function setUp(): void

public function testCreateTaskFailsWithUserLoggedOut(): void
{
$res = $this->makeRequest('web/services/createTasksService.php', null, 'POST', '');
$request = '<?xml version="1.0" encoding="ISO-8859-15"?>';
$request .= '<tasks sid="">'; // send an empty session
$request .= '<task><date>2023-03-24</date><initTime>00:00</initTime><endTime>03:00</endTime>';
$request .= '<customerId>1</customerId><projectId>1</projectId></task></tasks>';
$res = $this->makeRequest('web/services/createTasksService.php', null, 'POST', $request);
$this->assertEquals('You must be logged in', $res->error);
}

Expand Down

0 comments on commit d948653

Please sign in to comment.