Skip to content

Commit

Permalink
RepoTest::testSkipTombstone(): extend the test
Browse files Browse the repository at this point in the history
  • Loading branch information
zozlak committed Aug 6, 2024
1 parent f7ab41d commit 0743525
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/RepoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,18 @@ public function testSkipTombstone(): void {
self::$repo->begin();
$res1 = self::$repo->createResource($meta1);
$res2 = self::$repo->createResource($meta2);
$res2->delete(false);
self::$repo->commit();

$query = "SELECT id FROM identifiers WHERE ids IN (?, ?)";
$resources = self::$repo->getResourcesBySqlQuery($query, [$id1, $id2], new SearchConfig());
$resources = array_map(fn($x) => (string) $x->getUri(), iterator_to_array($resources));
$this->assertCount(2, $resources);
$this->assertContains((string) $res1->getUri(), $resources);
$this->assertContains((string) $res2->getUri(), $resources);

self::$repo->begin();
$res2->delete(false);
self::$repo->commit();
$client = new Client(['http_errors' => false]);
$resp = $client->sendRequest(new Request('get', (string) $res2->getUri()));
$this->assertEquals(410, $resp->getStatusCode());
Expand Down

0 comments on commit 0743525

Please sign in to comment.