Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
uryvskiy-dima committed Jan 16, 2024
1 parent f37434a commit cf0685f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
3 changes: 2 additions & 1 deletion src/ResourceGroup/Tasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public function edit(int $id, TasksCreateRequest $request): SuccessResponse
* $request->limit = 100;
* $request->page = 1;
* $request->filter = new TaskHistoryFilter();
* $request->filter->sinceId = 1111;
* $request->filter->sinceId = 1;
*
* try {
* $response = $client->tasks->history($request);
Expand Down Expand Up @@ -326,6 +326,7 @@ public function history(?TaskHistoryRequest $request = null): TasksHistoryRespon
$request,
TasksHistoryResponse::class
);

return $response;
}
}
40 changes: 20 additions & 20 deletions tests/src/ResourceGroup/TasksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,34 +185,34 @@ public function testHistory(): void
"success":true,
"history":[
{
"id":1,
"createdAt":"2023-03-22 19:00:29",
"created":true,
"source":"rule",
"field":"id",
"oldValue":null,
"newValue":1,
"task":{
"id":95978,
"text":"",
"commentary":"",
"createdAt":"2023-03-22 19:00:29",
"complete":false,
"performer":116,
"performerType":"user",
"id": 1,
"createdAt": "2023-03-22 19:00:29",
"created": true,
"source": "rule",
"field": "id",
"oldValue": null,
"newValue": 1,
"task": {
"id": 1,
"text": "",
"commentary": "",
"createdAt": "2023-03-22 19:00:29",
"complete": false,
"performer": 2,
"performerType": "user",
"customer":{
"type":"customer",
"id":1
"type": "customer",
"id": 1
}
}
}
]
}
EOF;

$mock = static::createApiMockBuilder('tasks/1');
$mock = static::createApiMockBuilder('tasks/history');
$mock->matchMethod(RequestMethod::GET)
->reply(200)
->reply()
->withBody($json);

$client = TestClientFactory::createClient($mock->getClient());
Expand All @@ -225,6 +225,6 @@ public function testHistory(): void

$response = $client->tasks->history($request);

self::assertModelEqualsToResponse($json, $response);
self::assertModelEqualsToResponse($json, $response, true);
}
}

0 comments on commit cf0685f

Please sign in to comment.