client->request('GET', '/api/entry-deletions'); $this->assertSame(200, $this->client->getResponse()->getStatusCode()); $content = json_decode($this->client->getResponse()->getContent(), true); // check that only the items for the current user are returned $this->assertEquals(2, \count($content['_embedded']['items'])); // validate the deletion schema on the first item $deletionData = $content['_embedded']['items'][0]; $this->assertArrayHasKey('id', $deletionData); $this->assertArrayHasKey('entry_id', $deletionData); $this->assertArrayHasKey('deleted_at', $deletionData); $this->assertArrayNotHasKey('user_id', $deletionData); } public function testGetEntryDeletionsSince() { // Test date range filter - get deletions from last 2 days $since = (new \DateTime('-2 days'))->getTimestamp(); $this->client->request('GET', "/api/entry-deletions?since={$since}"); $this->assertSame(200, $this->client->getResponse()->getStatusCode()); $content = json_decode($this->client->getResponse()->getContent(), true); $this->assertGreaterThanOrEqual(1, \count($content['_embedded']['items'])); } }