Skip to content

Commit bb1393b

Browse files
committed
PHP 7.2 doesn't allow indenting nowdoc closing identifiers
1 parent d46fb12 commit bb1393b

File tree

1 file changed

+48
-32
lines changed

1 file changed

+48
-32
lines changed

tests/ExamplesTest.php

Lines changed: 48 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,7 @@ public function testEncryptionExamples(string $file, string $expectedOutput): vo
216216

217217
public static function provideEncryptionExamples(): Generator
218218
{
219-
yield 'create_data_key' => [
220-
'file' => __DIR__ . '/../docs/examples/create_data_key.php',
221-
'expectedOutput' => <<<'OUTPUT'
219+
$expectedOutput = <<<'OUTPUT'
222220
MongoDB\BSON\Binary Object
223221
(
224222
[data] => %a
@@ -229,24 +227,28 @@ public static function provideEncryptionExamples(): Generator
229227
[data] => %a
230228
[type] => 6
231229
)
232-
OUTPUT,
230+
OUTPUT;
231+
232+
yield 'create_data_key' => [
233+
'file' => __DIR__ . '/../docs/examples/create_data_key.php',
234+
'expectedOutput' => $expectedOutput,
233235
];
234236

235-
yield 'key_alt_name' => [
236-
'file' => __DIR__ . '/../docs/examples/key_alt_name.php',
237-
'expectedOutput' => <<<'OUTPUT'
237+
$expectedOutput = <<<'OUTPUT'
238238
Error creating key: E11000 duplicate key error %s: encryption.__keyVault%sdup key: { keyAltNames: "myDataKey" }
239239
MongoDB\BSON\Binary Object
240240
(
241241
[data] => %a
242242
[type] => 6
243243
)
244-
OUTPUT,
244+
OUTPUT;
245+
246+
yield 'key_alt_name' => [
247+
'file' => __DIR__ . '/../docs/examples/key_alt_name.php',
248+
'expectedOutput' => $expectedOutput,
245249
];
246250

247-
yield 'csfle-automatic_encryption-local_schema' => [
248-
'file' => __DIR__ . '/../docs/examples/csfle-automatic_encryption-local_schema.php',
249-
'expectedOutput' => <<<'OUTPUT'
251+
$expectedOutput = <<<'OUTPUT'
250252
MongoDB\Model\BSONDocument Object
251253
(
252254
[storage:ArrayObject:private] => Array
@@ -271,12 +273,14 @@ public static function provideEncryptionExamples(): Generator
271273
272274
)
273275
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,
275281
];
276282

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'
280284
MongoDB\Model\BSONDocument Object
281285
(
282286
[storage:ArrayObject:private] => Array
@@ -301,12 +305,14 @@ public static function provideEncryptionExamples(): Generator
301305
302306
)
303307
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,
305313
];
306314

307-
yield 'csfle-explicit_encryption' => [
308-
'file' => __DIR__ . '/../docs/examples/csfle-explicit_encryption.php',
309-
'expectedOutput' => <<<'OUTPUT'
315+
$expectedOutput = <<<'OUTPUT'
310316
MongoDB\Model\BSONDocument Object
311317
(
312318
[storage:ArrayObject:private] => Array
@@ -322,12 +328,14 @@ public static function provideEncryptionExamples(): Generator
322328
323329
)
324330
Decrypted: mySecret
325-
OUTPUT,
331+
OUTPUT;
332+
333+
yield 'csfle-explicit_encryption' => [
334+
'file' => __DIR__ . '/../docs/examples/csfle-explicit_encryption.php',
335+
'expectedOutput' => $expectedOutput,
326336
];
327337

328-
yield 'csfle-explicit_encryption_automatic_decryption' => [
329-
'file' => __DIR__ . '/../docs/examples/csfle-explicit_encryption_automatic_decryption.php',
330-
'expectedOutput' => <<<'OUTPUT'
338+
$expectedOutput = <<<'OUTPUT'
331339
MongoDB\Model\BSONDocument Object
332340
(
333341
[storage:ArrayObject:private] => Array
@@ -337,7 +345,11 @@ public static function provideEncryptionExamples(): Generator
337345
)
338346
339347
)
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,
341353
];
342354
}
343355

@@ -361,9 +373,7 @@ public function testQueryableEncryptionExamples(string $file, string $expectedOu
361373

362374
public static function provideQueryableEncryptionExamples(): Generator
363375
{
364-
yield 'queryable_encryption-automatic' => [
365-
'file' => __DIR__ . '/../docs/examples/queryable_encryption-automatic.php',
366-
'expectedOutput' => <<<'OUTPUT'
376+
$expectedOutput = <<<'OUTPUT'
367377
MongoDB\Model\BSONDocument Object
368378
(
369379
[storage:ArrayObject:private] => Array
@@ -422,12 +432,14 @@ public static function provideQueryableEncryptionExamples(): Generator
422432
)
423433
424434
)
425-
OUTPUT,
435+
OUTPUT;
436+
437+
yield 'queryable_encryption-automatic' => [
438+
'file' => __DIR__ . '/../docs/examples/queryable_encryption-automatic.php',
439+
'expectedOutput' => $expectedOutput,
426440
];
427441

428-
yield 'queryable_encryption-explicit' => [
429-
'file' => __DIR__ . '/../docs/examples/queryable_encryption-explicit.php',
430-
'expectedOutput' => <<<'OUTPUT'
442+
$expectedOutput = <<<'OUTPUT'
431443
MongoDB\Model\BSONDocument Object
432444
(
433445
[storage:ArrayObject:private] => Array
@@ -452,7 +464,11 @@ public static function provideQueryableEncryptionExamples(): Generator
452464
)
453465
454466
)
455-
OUTPUT,
467+
OUTPUT;
468+
469+
yield 'queryable_encryption-explicit' => [
470+
'file' => __DIR__ . '/../docs/examples/queryable_encryption-explicit.php',
471+
'expectedOutput' => $expectedOutput,
456472
];
457473
}
458474

0 commit comments

Comments
 (0)