From 15fc90a466ef8b86460f4c17b7a3dbf404091810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Wed, 30 Oct 2024 08:25:57 +0100 Subject: [PATCH] disableMD5 option is allowed in the spec, but ignored --- tests/UnifiedSpecTests/Context.php | 5 ++++- tests/UnifiedSpecTests/Operation.php | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/UnifiedSpecTests/Context.php b/tests/UnifiedSpecTests/Context.php index 6b57a8130..6c8c3b168 100644 --- a/tests/UnifiedSpecTests/Context.php +++ b/tests/UnifiedSpecTests/Context.php @@ -463,7 +463,10 @@ private function createSession(string $id, stdClass $o): void private function createBucket(string $id, stdClass $o): void { - Util::assertHasOnlyKeys($o, ['id', 'database', 'bucketOptions']); + // Option "disableMD5" is transitional while other drivers remove support + // for "md5" fields. It is ignored since PHPLIB v2.0. + // https://github.com/mongodb/specifications/blob/9058491f2d5b5651913a56e373121a24d6498673/source/gridfs/gridfs-spec.md?plain=1#L281-L288 + Util::assertHasOnlyKeys($o, ['id', 'database', 'bucketOptions', 'disableMD5']); $databaseId = $o->database ?? null; assertIsString($databaseId); diff --git a/tests/UnifiedSpecTests/Operation.php b/tests/UnifiedSpecTests/Operation.php index 2ed73262d..d521a1055 100644 --- a/tests/UnifiedSpecTests/Operation.php +++ b/tests/UnifiedSpecTests/Operation.php @@ -770,9 +770,6 @@ private function executeForBucket(Bucket $bucket) { $args = $this->prepareArguments(); - // "md5" field is removed from the spec, option "disableMD5" is ignored - unset($args['disableMD5']); - Util::assertArgumentsBySchema(Bucket::class, $this->name, $args); switch ($this->name) {