phpstream\tests\unit\operations\SortedOperationTest::testSorted PHP Method

testSorted() public method

public testSorted ( )
    public function testSorted()
    {
        $instance = new SortedOperation([6, 2, 9, 4, 7, 12, 3, 1]);
        $result = iterator_to_array($instance);
        $expected = [7 => 1, 1 => 2, 6 => 3, 3 => 4, 0 => 6, 4 => 7, 2 => 9, 5 => 12];
        $this->assertEquals($expected, $result);
    }