Add bucket teardown to folder tests and dot segment validator case

This commit is contained in:
Torsten Dittmann committed 2026-07-06 20:57:55 +04:00
1 parent ea68308838
commit ff14e5dcec
3 files changed
+29

No files matched your search

@@ -596,6 +596,13 @@ trait StorageBase
$this->assertEquals(201, $chunked['headers']['status-code']);
$this->assertEquals('videos/2026/', $chunked['body']['parent']);
$this->assertEquals('videos/2026/large-file.mp4', $chunked['body']['key']);
$response = $this->client->call(Client::METHOD_DELETE, '/storage/buckets/' . $bucketId, [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
]);
$this->assertEquals(204, $response['headers']['status-code']);
}
public function testCreateBucketFileZstdCompression(): void
@@ -2063,6 +2070,13 @@ trait StorageBase
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), ['parent' => '/photos']);
$this->assertEquals(400, $response['headers']['status-code']);
$response = $this->client->call(Client::METHOD_DELETE, '/storage/buckets/' . $bucketId, [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
]);
$this->assertEquals(204, $response['headers']['status-code']);
}
public function testListFolders(): void
@@ -2144,5 +2158,12 @@ trait StorageBase
], $this->getHeaders()));
$this->assertEquals(204, $delete['headers']['status-code']);
$this->assertEquals(['photos/2025/'], \array_column($listFolders(['parent' => 'photos']), 'key'));
$response = $this->client->call(Client::METHOD_DELETE, '/storage/buckets/' . $bucketId, [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
]);
$this->assertEquals(204, $response['headers']['status-code']);
}
}
@@ -1645,5 +1645,12 @@ final class StorageCustomClientTest extends Scope
], $this->getHeaders()));
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertEquals(['shared/'], \array_column($response['body']['folders'], 'key'));
$response = $this->client->call(Client::METHOD_DELETE, '/storage/buckets/' . $bucketId, [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
]);
$this->assertEquals(204, $response['headers']['status-code']);
}
}
@@ -38,6 +38,7 @@ final class FolderTest extends TestCase
$this->assertFalse($this->object->isValid('photos/./2026'));
$this->assertFalse($this->object->isValid('photos/../2026'));
$this->assertFalse($this->object->isValid('..'));
$this->assertFalse($this->object->isValid('.'));
$this->assertFalse($this->object->isValid("photos/\x01"));
$this->assertFalse($this->object->isValid("photos\n"));
// 2048 chars without trailing slash normalizes to 2049 -- too long