Skip to content

Commit

Permalink
Update tests based on PHPstan feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Strift committed Dec 4, 2024
1 parent 2e409e3 commit aab82ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
17 changes: 0 additions & 17 deletions src/Contracts/BatchesQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ class BatchesQuery
*/
private ?int $limit = null;

/**
* @var non-empty-list<int>|null
*/
private ?array $canceledBy = null;

private ?bool $reverse = null;

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

/**
* @param non-empty-list<int> $canceledBy
*
* @return $this
*/
public function setCanceledBy(array $canceledBy): self
{
$this->canceledBy = $canceledBy;

return $this;
}

/**
* @return $this
*/
Expand Down
10 changes: 5 additions & 5 deletions tests/Endpoints/BatchesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected function setUp(): void
public function testGetAllBatches(): void
{
$response = $this->client->getBatches();
self::assertIsArray($response->getResults());
self::assertGreaterThan(0, $response->getTotal());
}

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

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

$batches = $this->client->getBatches((new BatchesQuery())
->setAfterEnqueuedAt($startDate)
->setAfterEnqueuedAt($startDate)
);
$reversedBatches = $this->client->getBatches((new BatchesQuery())
->setAfterEnqueuedAt($startDate)
->setReverse(true)
->setAfterEnqueuedAt($startDate)
->setReverse(true)
);
self::assertSame($batches->getResults(), array_reverse($reversedBatches->getResults()));
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Endpoints/TasksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function getAllTasksClientWithBatchFilter(): void
->setBatchUid($task['uid'])
);

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

public function testGetOneTaskIndex(): void
Expand Down

0 comments on commit aab82ed

Please sign in to comment.