@@ -10,28 +10,35 @@ class CollectionInfoTest extends TestCase
10
10
{
11
11
public function testGetBasicInformation (): void
12
12
{
13
- $ info = new CollectionInfo ([
13
+ $ viewInfo = new CollectionInfo ([
14
14
'name ' => 'foo ' ,
15
15
'type ' => 'view ' ,
16
16
'options ' => ['capped ' => true , 'size ' => 1_048_576 ],
17
17
'info ' => ['readOnly ' => true ],
18
18
'idIndex ' => ['idIndex ' => true ], // Dummy option
19
19
]);
20
20
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 ' ]);
23
26
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 ' ]);
26
29
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 ' ]);
29
32
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
+ ]);
32
40
33
- $ this ->assertSame (['idIndex ' => true ], $ info ->getIdIndex ());
34
- $ this ->assertSame (['idIndex ' => true ], $ info ['idIndex ' ]);
41
+ $ this ->assertFalse ($ collectionInfo ->isView ());
35
42
}
36
43
37
44
public function testMissingFields (): void
0 commit comments