Pinq\Tests\Integration\Collection\MutableCollectionSemanticsTest::testThatUnsetIndexUnsetsFromAllCollections PHP Метод

testThatUnsetIndexUnsetsFromAllCollections() публичный Метод

public testThatUnsetIndexUnsetsFromAllCollections ( Pinq\ICollection $collection, array $data )
$collection Pinq\ICollection
$data array
    public function testThatUnsetIndexUnsetsFromAllCollections(\Pinq\ICollection $collection, array $data)
    {
        $filteredScopeCollection = $collection->where(function ($i) {
            return $i % 2 === 0;
        });
        $slicedScopeCollection = $filteredScopeCollection->slice(1, 2);
        unset($slicedScopeCollection[3]);
        $this->assertMatches($slicedScopeCollection, [5 => 6, 7 => 8]);
        $this->assertMatches($collection, [1, 2, 3, 4 => 5, 5 => 6, 6 => 7, 7 => 8, 8 => 9, 9 => 10]);
    }