Skip to content

Commit aab82ed

Browse files
committed
Update tests based on PHPstan feedback
1 parent 2e409e3 commit aab82ed

File tree

3 files changed

+6
-23
lines changed

3 files changed

+6
-23
lines changed

src/Contracts/BatchesQuery.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ class BatchesQuery
1717
*/
1818
private ?int $limit = null;
1919

20-
/**
21-
* @var non-empty-list<int>|null
22-
*/
23-
private ?array $canceledBy = null;
24-
2520
private ?bool $reverse = null;
2621

2722
/**
@@ -34,18 +29,6 @@ public function setFrom(int $from): self
3429
return $this;
3530
}
3631

37-
/**
38-
* @param non-empty-list<int> $canceledBy
39-
*
40-
* @return $this
41-
*/
42-
public function setCanceledBy(array $canceledBy): self
43-
{
44-
$this->canceledBy = $canceledBy;
45-
46-
return $this;
47-
}
48-
4932
/**
5033
* @return $this
5134
*/

tests/Endpoints/BatchesTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected function setUp(): void
2222
public function testGetAllBatches(): void
2323
{
2424
$response = $this->client->getBatches();
25-
self::assertIsArray($response->getResults());
25+
self::assertGreaterThan(0, $response->getTotal());
2626
}
2727

2828
public function testGetAllBatchesWithIndexUidFilters(): void
@@ -37,19 +37,19 @@ public function testGetAllBatchesWithTasksFilters(): void
3737
{
3838
$tasks = $this->client->getTasks(new TasksQuery())->getResults();
3939
$response = $this->client->getBatches((new BatchesQuery())->setUids([$tasks[0]['uid']]));
40-
self::assertNotNull($response->getResults());
40+
self::assertGreaterThan(0, $response->getTotal());
4141
}
4242

4343
public function testGetAllBatchesInReverseOrder(): void
4444
{
4545
$startDate = new \DateTimeImmutable('now');
4646

4747
$batches = $this->client->getBatches((new BatchesQuery())
48-
->setAfterEnqueuedAt($startDate)
48+
->setAfterEnqueuedAt($startDate)
4949
);
5050
$reversedBatches = $this->client->getBatches((new BatchesQuery())
51-
->setAfterEnqueuedAt($startDate)
52-
->setReverse(true)
51+
->setAfterEnqueuedAt($startDate)
52+
->setReverse(true)
5353
);
5454
self::assertSame($batches->getResults(), array_reverse($reversedBatches->getResults()));
5555
}

tests/Endpoints/TasksTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function getAllTasksClientWithBatchFilter(): void
8585
->setBatchUid($task['uid'])
8686
);
8787

88-
self::assertIsArray($response->getResults());
88+
self::assertGreaterThan(0, $response->getTotal());
8989
}
9090

9191
public function testGetOneTaskIndex(): void

0 commit comments

Comments
 (0)