Skip to content

Commit

Permalink
scaffold out more failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gwleuverink committed Aug 26, 2024
1 parent 32299fd commit c4e7cb8
Showing 1 changed file with 46 additions and 3 deletions.
49 changes: 46 additions & 3 deletions tests/Unit/MacroTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,51 @@
]);
});

it('returns array keys when keys() method was chained')->todo();
it('returns array values when values() method was chained')->todo();
it('has no unexpected side effects if both keys() and values() are called in the same chain')->todo();
it('returns array keys when keys() method was chained', function () {
$component = new class extends TestComponent
{
#[Group('a')]
public $foo = 1;
};

expect(
group($component, 'a')->keys()
)
->toBe([
'foo',
]);
});

it('returns array values when values() method was chained', function () {
$component = new class extends TestComponent
{
#[Group('a')]
public $foo = 1;
};

expect(
group($component, 'a')->values()
)
->toBe([
1,
]);
});

it('has no unexpected side effects if both keys() and values() are called in the same chain', function () {
$component = new class extends TestComponent
{
#[Group('a')]
public $foo = 1;
};

expect(
group($component, 'a')->keys()->values()
)
->toBe([
1,
]);
});

// 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

0 comments on commit c4e7cb8

Please sign in to comment.