Skip to content

Commit

Permalink
add test here
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Nov 27, 2024
1 parent 611d7ec commit d128665
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/Fields/ValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Statamic\Fields\Field;
use Statamic\Fields\Fieldtype;
use Statamic\Fields\Value;
use Statamic\Fields\Values;
use Statamic\Query\Builder;
use Tests\TestCase;

Expand Down Expand Up @@ -301,6 +302,26 @@ public function it_can_iterate_over_query_builder()
], $arr);
}

#[Test]
public function it_can_iterate_over_values()
{
$val = new Value(new Values([
'a' => 'alfa',
'b' => 'bravo',
]));

$arr = [];

foreach ($val as $key => $value) {
$arr[$key] = $value;
}

$this->assertEquals([
'a' => 'alfa',
'b' => 'bravo',
], $arr);
}

#[Test]
public function it_can_proxy_methods_to_value()
{
Expand Down

0 comments on commit d128665

Please sign in to comment.