We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f7349e commit e2384aaCopy full SHA for e2384aa
tests/Model/IndexInfoTest.php
@@ -97,6 +97,20 @@ public function testDebugInfo()
97
$this->assertSame($expectedInfo, $info->__debugInfo());
98
}
99
100
+ public function testImplementsArrayAccess()
101
+ {
102
+ $info = new IndexInfo([
103
+ 'v' => 1,
104
+ 'key' => ['x' => 1],
105
+ 'name' => 'x_1',
106
+ 'ns' => 'foo.bar',
107
+ ]);
108
+
109
+ $this->assertInstanceOf('ArrayAccess', $info);
110
+ $this->assertTrue(isset($info['name']));
111
+ $this->assertSame('x_1', $info['name']);
112
+ }
113
114
/**
115
* @expectedException MongoDB\Exception\BadMethodCallException
116
* @expectedExceptionMessage MongoDB\Model\IndexInfo is immutable
0 commit comments