Functional\Tests\PluckTest::testPluckNumericArrayIndex PHP Méthode

testPluckNumericArrayIndex() public méthode

    public function testPluckNumericArrayIndex()
    {
        $this->assertSame(['one' => 1, 'two' => null, 'three' => null, 'four' => 2, 'five' => 3], pluck($this->numericArrayCollection, 0));
        $this->assertSame(['one' => 1, 'two' => null, 'three' => null, 'four' => 2, 'five' => 3], pluck($this->numericArrayCollection, 0));
        $this->assertSame(['one' => 1, 'two' => null, 'three' => null, 'four' => 2, 'five' => 3], pluck(new ArrayIterator($this->numericArrayCollection), 0));
        $this->assertSame([1, null, null, 2, 3], pluck(array_values($this->numericArrayCollection), 0));
        $this->assertSame([1, null, null, 2, 3], pluck(new ArrayIterator(array_values($this->numericArrayCollection)), 0));
        $this->assertSame(['one' => 1, 'two' => null, 'three' => null, 'four' => 2, 'five' => 3], pluck($this->numericArrayCollection, '0'));
    }