Skip to content

Commit

Permalink
add more failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gwleuverink committed Aug 26, 2024
1 parent 4e2f62e commit bb59b1d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/Unit/MacroTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@
]);
});

it('can iterate over properties in a group when the each() method was chained', function () {
$component = new class extends TestComponent
{
#[Group('a')]
public $foo = 1;

#[Group('a')]
public $bar = 2;
};

$iterations = 0;

group($component, 'a')->each(fn () => $iterations++);

expect($iterations)->toBe(2);
});

// Should be Integration tests? Component not mounted on unit level. Can't reset properties this way
it('resets all properties in a group when the reset() method was chained')->todo(); // add two groups for unhappy path
it('returns & resets all properties in a group when the pull() method was chained')->todo(); // add two groups for unhappy path
it('validates all properties in a group when the validate() method was chained')->todo(); // add two groups for unhappy path

0 comments on commit bb59b1d

Please sign in to comment.