@@ -10,28 +10,35 @@ class CollectionInfoTest extends TestCase
1010{
1111 public function testGetBasicInformation (): void
1212 {
13- $ info = new CollectionInfo ([
13+ $ viewInfo = new CollectionInfo ([
1414 'name ' => 'foo ' ,
1515 'type ' => 'view ' ,
1616 'options ' => ['capped ' => true , 'size ' => 1_048_576 ],
1717 'info ' => ['readOnly ' => true ],
1818 'idIndex ' => ['idIndex ' => true ], // Dummy option
1919 ]);
2020
21- $ this ->assertSame ('foo ' , $ info ->getName ());
22- $ this ->assertSame ('foo ' , $ info ['name ' ]);
21+ $ this ->assertSame ('foo ' , $ viewInfo ->getName ());
22+ $ this ->assertSame ('foo ' , $ viewInfo ['name ' ]);
23+
24+ $ this ->assertTrue ($ viewInfo ->isView ());
25+ $ this ->assertSame ('view ' , $ viewInfo ['type ' ]);
2326
24- $ this ->assertSame (' view ' , $ info -> getType ());
25- $ this ->assertSame (' view ' , $ info [ ' type ' ]);
27+ $ this ->assertSame ([ ' capped ' => true , ' size ' => 1_048_576 ], $ viewInfo -> getOptions ());
28+ $ this ->assertSame ([ ' capped ' => true , ' size ' => 1_048_576 ], $ viewInfo [ ' options ' ]);
2629
27- $ this ->assertSame (['capped ' => true , ' size ' => 1_048_576 ], $ info -> getOptions ());
28- $ this ->assertSame (['capped ' => true , ' size ' => 1_048_576 ], $ info [ ' options ' ]);
30+ $ this ->assertSame (['readOnly ' => true ], $ viewInfo -> getInfo ());
31+ $ this ->assertSame (['readOnly ' => true ], $ viewInfo [ ' info ' ]);
2932
30- $ this ->assertSame (['readOnly ' => true ], $ info ->getInfo ());
31- $ this ->assertSame (['readOnly ' => true ], $ info ['info ' ]);
33+ $ this ->assertSame (['idIndex ' => true ], $ viewInfo ->getIdIndex ());
34+ $ this ->assertSame (['idIndex ' => true ], $ viewInfo ['idIndex ' ]);
35+
36+ $ collectionInfo = new CollectionInfo ([
37+ 'name ' => 'bar ' ,
38+ 'type ' => 'collection ' ,
39+ ]);
3240
33- $ this ->assertSame (['idIndex ' => true ], $ info ->getIdIndex ());
34- $ this ->assertSame (['idIndex ' => true ], $ info ['idIndex ' ]);
41+ $ this ->assertFalse ($ collectionInfo ->isView ());
3542 }
3643
3744 public function testMissingFields (): void
0 commit comments