@@ -216,9 +216,7 @@ public function testEncryptionExamples(string $file, string $expectedOutput): vo
216
216
217
217
public static function provideEncryptionExamples (): Generator
218
218
{
219
- yield 'create_data_key ' => [
220
- 'file ' => __DIR__ . '/../docs/examples/create_data_key.php ' ,
221
- 'expectedOutput ' => <<<'OUTPUT'
219
+ $ expectedOutput = <<<'OUTPUT'
222
220
MongoDB\BSON\Binary Object
223
221
(
224
222
[data] => %a
@@ -229,24 +227,28 @@ public static function provideEncryptionExamples(): Generator
229
227
[data] => %a
230
228
[type] => 6
231
229
)
232
- OUTPUT,
230
+ OUTPUT;
231
+
232
+ yield 'create_data_key ' => [
233
+ 'file ' => __DIR__ . '/../docs/examples/create_data_key.php ' ,
234
+ 'expectedOutput ' => $ expectedOutput ,
233
235
];
234
236
235
- yield 'key_alt_name ' => [
236
- 'file ' => __DIR__ . '/../docs/examples/key_alt_name.php ' ,
237
- 'expectedOutput ' => <<<'OUTPUT'
237
+ $ expectedOutput = <<<'OUTPUT'
238
238
Error creating key: E11000 duplicate key error %s: encryption.__keyVault%sdup key: { keyAltNames: "myDataKey" }
239
239
MongoDB\BSON\Binary Object
240
240
(
241
241
[data] => %a
242
242
[type] => 6
243
243
)
244
- OUTPUT,
244
+ OUTPUT;
245
+
246
+ yield 'key_alt_name ' => [
247
+ 'file ' => __DIR__ . '/../docs/examples/key_alt_name.php ' ,
248
+ 'expectedOutput ' => $ expectedOutput ,
245
249
];
246
250
247
- yield 'csfle-automatic_encryption-local_schema ' => [
248
- 'file ' => __DIR__ . '/../docs/examples/csfle-automatic_encryption-local_schema.php ' ,
249
- 'expectedOutput ' => <<<'OUTPUT'
251
+ $ expectedOutput = <<<'OUTPUT'
250
252
MongoDB\Model\BSONDocument Object
251
253
(
252
254
[storage:ArrayObject:private] => Array
@@ -271,12 +273,14 @@ public static function provideEncryptionExamples(): Generator
271
273
272
274
)
273
275
Error inserting document: Document failed validation
274
- OUTPUT,
276
+ OUTPUT;
277
+
278
+ yield 'csfle-automatic_encryption-local_schema ' => [
279
+ 'file ' => __DIR__ . '/../docs/examples/csfle-automatic_encryption-local_schema.php ' ,
280
+ 'expectedOutput ' => $ expectedOutput ,
275
281
];
276
282
277
- yield 'csfle-automatic_encryption-server_side_schema ' => [
278
- 'file ' => __DIR__ . '/../docs/examples/csfle-automatic_encryption-server_side_schema.php ' ,
279
- 'expectedOutput ' => <<<'OUTPUT'
283
+ $ expectedOutput = <<<'OUTPUT'
280
284
MongoDB\Model\BSONDocument Object
281
285
(
282
286
[storage:ArrayObject:private] => Array
@@ -301,12 +305,14 @@ public static function provideEncryptionExamples(): Generator
301
305
302
306
)
303
307
Error inserting document: Document failed validation
304
- OUTPUT,
308
+ OUTPUT;
309
+
310
+ yield 'csfle-automatic_encryption-server_side_schema ' => [
311
+ 'file ' => __DIR__ . '/../docs/examples/csfle-automatic_encryption-server_side_schema.php ' ,
312
+ 'expectedOutput ' => $ expectedOutput ,
305
313
];
306
314
307
- yield 'csfle-explicit_encryption ' => [
308
- 'file ' => __DIR__ . '/../docs/examples/csfle-explicit_encryption.php ' ,
309
- 'expectedOutput ' => <<<'OUTPUT'
315
+ $ expectedOutput = <<<'OUTPUT'
310
316
MongoDB\Model\BSONDocument Object
311
317
(
312
318
[storage:ArrayObject:private] => Array
@@ -322,12 +328,14 @@ public static function provideEncryptionExamples(): Generator
322
328
323
329
)
324
330
Decrypted: mySecret
325
- OUTPUT,
331
+ OUTPUT;
332
+
333
+ yield 'csfle-explicit_encryption ' => [
334
+ 'file ' => __DIR__ . '/../docs/examples/csfle-explicit_encryption.php ' ,
335
+ 'expectedOutput ' => $ expectedOutput ,
326
336
];
327
337
328
- yield 'csfle-explicit_encryption_automatic_decryption ' => [
329
- 'file ' => __DIR__ . '/../docs/examples/csfle-explicit_encryption_automatic_decryption.php ' ,
330
- 'expectedOutput ' => <<<'OUTPUT'
338
+ $ expectedOutput = <<<'OUTPUT'
331
339
MongoDB\Model\BSONDocument Object
332
340
(
333
341
[storage:ArrayObject:private] => Array
@@ -337,7 +345,11 @@ public static function provideEncryptionExamples(): Generator
337
345
)
338
346
339
347
)
340
- OUTPUT,
348
+ OUTPUT;
349
+
350
+ yield 'csfle-explicit_encryption_automatic_decryption ' => [
351
+ 'file ' => __DIR__ . '/../docs/examples/csfle-explicit_encryption_automatic_decryption.php ' ,
352
+ 'expectedOutput ' => $ expectedOutput ,
341
353
];
342
354
}
343
355
@@ -361,9 +373,7 @@ public function testQueryableEncryptionExamples(string $file, string $expectedOu
361
373
362
374
public static function provideQueryableEncryptionExamples (): Generator
363
375
{
364
- yield 'queryable_encryption-automatic ' => [
365
- 'file ' => __DIR__ . '/../docs/examples/queryable_encryption-automatic.php ' ,
366
- 'expectedOutput ' => <<<'OUTPUT'
376
+ $ expectedOutput = <<<'OUTPUT'
367
377
MongoDB\Model\BSONDocument Object
368
378
(
369
379
[storage:ArrayObject:private] => Array
@@ -422,12 +432,14 @@ public static function provideQueryableEncryptionExamples(): Generator
422
432
)
423
433
424
434
)
425
- OUTPUT,
435
+ OUTPUT;
436
+
437
+ yield 'queryable_encryption-automatic ' => [
438
+ 'file ' => __DIR__ . '/../docs/examples/queryable_encryption-automatic.php ' ,
439
+ 'expectedOutput ' => $ expectedOutput ,
426
440
];
427
441
428
- yield 'queryable_encryption-explicit ' => [
429
- 'file ' => __DIR__ . '/../docs/examples/queryable_encryption-explicit.php ' ,
430
- 'expectedOutput ' => <<<'OUTPUT'
442
+ $ expectedOutput = <<<'OUTPUT'
431
443
MongoDB\Model\BSONDocument Object
432
444
(
433
445
[storage:ArrayObject:private] => Array
@@ -452,7 +464,11 @@ public static function provideQueryableEncryptionExamples(): Generator
452
464
)
453
465
454
466
)
455
- OUTPUT,
467
+ OUTPUT;
468
+
469
+ yield 'queryable_encryption-explicit ' => [
470
+ 'file ' => __DIR__ . '/../docs/examples/queryable_encryption-explicit.php ' ,
471
+ 'expectedOutput ' => $ expectedOutput ,
456
472
];
457
473
}
458
474
0 commit comments