Nelmio\Alice\Definition\PropertyBagTest::testIsIterable PHP Метод

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

public testIsIterable ( )
    public function testIsIterable()
    {
        $property1 = new Property('username', 'alice');
        $property2 = new Property('owner', 'bob');
        $bag = (new PropertyBag())->with($property1)->with($property2);
        $array = [];
        foreach ($bag as $index => $property) {
            $array[$index] = $property;
        }
        $this->assertSame([$property1, $property2], $array);
    }