public function testSlicePreservingKeys() { $xao = new XArray([3 => 5, 6 => 2, 0 => 6, 7 => 3]); // without $this->assertEquals([2, 6], (array) $xao->slice(1, 2)); $this->assertEquals([2, 6], (array) $xao->slice(1, 2, XAInterface::IGNORE_KEYS)); // with $this->assertEquals([6 => 2, 0 => 6], (array) $xao->slice(1, 2, XAInterface::PRESERVE_KEYS)); // without length $this->assertEquals([6 => 2, 0 => 6, 7 => 3], (array) $xao->slice(1, NULL, XAInterface::PRESERVE_KEYS)); }