Commit e2384aae authored by Jeremy Mikola's avatar Jeremy Mikola

Unit test for IndexInfo's ArrayAccess implementation

parent 4f7349e9
......@@ -97,6 +97,20 @@ class IndexInfoTest extends TestCase
$this->assertSame($expectedInfo, $info->__debugInfo());
}
public function testImplementsArrayAccess()
{
$info = new IndexInfo([
'v' => 1,
'key' => ['x' => 1],
'name' => 'x_1',
'ns' => 'foo.bar',
]);
$this->assertInstanceOf('ArrayAccess', $info);
$this->assertTrue(isset($info['name']));
$this->assertSame('x_1', $info['name']);
}
/**
* @expectedException MongoDB\Exception\BadMethodCallException
* @expectedExceptionMessage MongoDB\Model\IndexInfo is immutable
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment