16
16
use MongoDB \Driver \ClientEncryption ;
17
17
use MongoDB \Driver \Exception \EncryptionException ;
18
18
use MultipleIterator ;
19
+ use PHPUnit \Framework \Attributes \DataProvider ;
20
+ use PHPUnit \Framework \Attributes \Group ;
19
21
20
22
use function base64_decode ;
21
23
use function file_get_contents ;
26
28
* Prose test 22: Range Explicit Encryption
27
29
*
28
30
* @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#22-range-explicit-encryption
29
- * @group csfle
30
- * @group serverless
31
31
*/
32
+ #[Group('csfle ' )]
33
+ #[Group('serverless ' )]
32
34
class Prose22_RangeExplicitEncryptionTest extends FunctionalTestCase
33
35
{
34
36
private ?ClientEncryption $ clientEncryption = null ;
@@ -178,10 +180,8 @@ public static function provideTypeAndRangeOpts(): Generator
178
180
];
179
181
}
180
182
181
- /**
182
- * @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#case-1-can-decrypt-a-payload
183
- * @dataProvider provideTypeAndRangeOpts
184
- */
183
+ /** @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#case-1-can-decrypt-a-payload */
184
+ #[DataProvider('provideTypeAndRangeOpts ' )]
185
185
public function testCase1_CanDecryptAPayload (string $ type , array $ rangeOpts ): void
186
186
{
187
187
$ this ->setUpWithTypeAndRangeOpts ($ type , $ rangeOpts );
@@ -211,10 +211,8 @@ public function testCase1_CanDecryptAPayload(string $type, array $rangeOpts): vo
211
211
$ this ->assertEquals ($ originalValue , $ decryptedValue );
212
212
}
213
213
214
- /**
215
- * @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#case-2-can-find-encrypted-range-and-return-the-maximum
216
- * @dataProvider provideTypeAndRangeOpts
217
- */
214
+ /** @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#case-2-can-find-encrypted-range-and-return-the-maximum */
215
+ #[DataProvider('provideTypeAndRangeOpts ' )]
218
216
public function testCase2_CanFindEncryptedRangeAndReturnTheMaximum (string $ type , array $ rangeOpts ): void
219
217
{
220
218
$ this ->setUpWithTypeAndRangeOpts ($ type , $ rangeOpts );
@@ -248,10 +246,8 @@ public function testCase2_CanFindEncryptedRangeAndReturnTheMaximum(string $type,
248
246
$ this ->assertMultipleDocumentsMatch ($ expectedDocuments , $ cursor );
249
247
}
250
248
251
- /**
252
- * @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#case-3-can-find-encrypted-range-and-return-the-minimum
253
- * @dataProvider provideTypeAndRangeOpts
254
- */
249
+ /** @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#case-3-can-find-encrypted-range-and-return-the-minimum */
250
+ #[DataProvider('provideTypeAndRangeOpts ' )]
255
251
public function testCase3_CanFindEncryptedRangeAndReturnTheMinimum (string $ type , array $ rangeOpts ): void
256
252
{
257
253
$ this ->setUpWithTypeAndRangeOpts ($ type , $ rangeOpts );
@@ -284,10 +280,8 @@ public function testCase3_CanFindEncryptedRangeAndReturnTheMinimum(string $type,
284
280
$ this ->assertMultipleDocumentsMatch ($ expectedDocuments , $ cursor );
285
281
}
286
282
287
- /**
288
- * @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#case-4-can-find-encrypted-range-with-an-open-range-query
289
- * @dataProvider provideTypeAndRangeOpts
290
- */
283
+ /** @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#case-4-can-find-encrypted-range-with-an-open-range-query */
284
+ #[DataProvider('provideTypeAndRangeOpts ' )]
291
285
public function testCase4_CanFindEncryptedRangeWithAnOpenRangeQuery (string $ type , array $ rangeOpts ): void
292
286
{
293
287
$ this ->setUpWithTypeAndRangeOpts ($ type , $ rangeOpts );
@@ -311,10 +305,8 @@ public function testCase4_CanFindEncryptedRangeWithAnOpenRangeQuery(string $type
311
305
$ this ->assertMultipleDocumentsMatch ($ expectedDocuments , $ cursor );
312
306
}
313
307
314
- /**
315
- * @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#case-5-can-run-an-aggregation-expression-inside-expr
316
- * @dataProvider provideTypeAndRangeOpts
317
- */
308
+ /** @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#case-5-can-run-an-aggregation-expression-inside-expr */
309
+ #[DataProvider('provideTypeAndRangeOpts ' )]
318
310
public function testCase5_CanRunAnAggregationExpressionInsideExpr (string $ type , array $ rangeOpts ): void
319
311
{
320
312
$ this ->setUpWithTypeAndRangeOpts ($ type , $ rangeOpts );
@@ -343,10 +335,8 @@ public function testCase5_CanRunAnAggregationExpressionInsideExpr(string $type,
343
335
$ this ->assertMultipleDocumentsMatch ($ expectedDocuments , $ cursor );
344
336
}
345
337
346
- /**
347
- * @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#case-6-encrypting-a-document-greater-than-the-maximum-errors
348
- * @dataProvider provideTypeAndRangeOpts
349
- */
338
+ /** @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#case-6-encrypting-a-document-greater-than-the-maximum-errors */
339
+ #[DataProvider('provideTypeAndRangeOpts ' )]
350
340
public function testCase6_EncryptingADocumentGreaterThanTheMaximumErrors (string $ type , array $ rangeOpts ): void
351
341
{
352
342
if ($ type === 'DecimalNoPrecision ' || $ type === 'DoubleNoPrecision ' ) {
@@ -367,10 +357,8 @@ public function testCase6_EncryptingADocumentGreaterThanTheMaximumErrors(string
367
357
$ this ->clientEncryption ->encrypt (self ::cast ($ type , 201 ), $ encryptOpts );
368
358
}
369
359
370
- /**
371
- * @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#case-7-encrypting-a-value-of-a-different-type-errors
372
- * @dataProvider provideTypeAndRangeOpts
373
- */
360
+ /** @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#case-7-encrypting-a-value-of-a-different-type-errors */
361
+ #[DataProvider('provideTypeAndRangeOpts ' )]
374
362
public function testCase7_EncryptingAValueOfADifferentTypeErrors (string $ type , array $ rangeOpts ): void
375
363
{
376
364
if ($ type === 'DecimalNoPrecision ' || $ type === 'DoubleNoPrecision ' ) {
@@ -395,10 +383,8 @@ public function testCase7_EncryptingAValueOfADifferentTypeErrors(string $type, a
395
383
$ this ->clientEncryption ->encrypt ($ value , $ encryptOpts );
396
384
}
397
385
398
- /**
399
- * @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#case-8-setting-precision-errors-if-the-type-is-not-double-or-decimal128
400
- * @dataProvider provideTypeAndRangeOpts
401
- */
386
+ /** @see https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#case-8-setting-precision-errors-if-the-type-is-not-double-or-decimal128 */
387
+ #[DataProvider('provideTypeAndRangeOpts ' )]
402
388
public function testCase8_SettingPrecisionErrorsIfTheTypeIsNotDoubleOrDecimal128 (string $ type , array $ rangeOpts ): void
403
389
{
404
390
if ($ type === 'DecimalNoPrecision ' || $ type === 'DecimalPrecision ' || $ type === 'DoubleNoPrecision ' || $ type === 'DoublePrecision ' ) {
0 commit comments