@@ -34,20 +34,18 @@ public function testCreateAndQueryEncryptedCollection(): void
34
34
self ::assertContains ('datakeys ' , $ collectionNames );
35
35
36
36
// Insert a document
37
- $ patient = new Patient ();
38
- $ patient ->patientName = 'Jon Doe ' ;
39
- $ patient ->patientId = 12345678 ;
40
-
41
- $ patientRecord = new PatientRecord ();
42
- $ patientRecord ->ssn = '987-65-4320 ' ;
43
- $ patientRecord ->billingAmount = 1200 ;
44
-
45
- $ billing = new PatientBilling ();
46
- $ billing ->type = 'Visa ' ;
47
- $ billing ->number = '4111111111111111 ' ;
48
-
49
- $ patientRecord ->billing = $ billing ;
50
- $ patient ->patientRecord = $ patientRecord ;
37
+ $ patient = new Patient (
38
+ patientName: 'Jon Doe ' ,
39
+ patientId: 12345678 ,
40
+ patientRecord: new PatientRecord (
41
+ ssn: '987-65-4320 ' ,
42
+ billing: new PatientBilling (
43
+ type: 'Visa ' ,
44
+ number: '4111111111111111 ' ,
45
+ ),
46
+ billingAmount: 1200 ,
47
+ ),
48
+ );
51
49
52
50
$ this ->dm ->persist ($ patient );
53
51
$ this ->dm ->flush ();
@@ -58,6 +56,7 @@ public function testCreateAndQueryEncryptedCollection(): void
58
56
self ::assertNotNull ($ result );
59
57
self ::assertSame ('Jon Doe ' , $ result ->patientName );
60
58
self ::assertSame ('987-65-4320 ' , $ result ->patientRecord ->ssn );
59
+ self ::assertSame ('4111111111111111 ' , $ result ->patientRecord ->billing ->number );
61
60
62
61
// Queryable with range
63
62
$ result = $ this ->dm ->getRepository (Patient::class)->findOneBy (['patientRecord.billingAmount ' => ['$gt ' => 1000 , '$lt ' => 2000 ]]);
0 commit comments