/** * @dataProvider instanceProvider * * @since 0.6 * * @param Diff $list */ public function testUnset(Diff $list) { if ($list->isEmpty()) { $this->assertTrue(true); // We cannot test unset if there are no elements } else { $offset = $list->getIterator()->key(); $count = $list->count(); $list->offsetUnset($offset); $this->assertEquals($count - 1, $list->count()); } if (!$list->isEmpty()) { $offset = $list->getIterator()->key(); $count = $list->count(); unset($list[$offset]); $this->assertEquals($count - 1, $list->count()); } }