Skip to content

Commit

Permalink
add unit macro tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gwleuverink committed Aug 26, 2024
1 parent 9f29a31 commit 32299fd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

uses(Tests\TestCase::class)->in('Integration');
uses(Tests\TestCase::class)->in('Unit', 'Integration');
19 changes: 18 additions & 1 deletion tests/Integration/MacroTest.php → tests/Unit/MacroTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
<?php

it('returns multidimensional array if no methods where chained')->todo();
use Tests\TestComponent;
use Leuverink\PropertyAttribute\Group;

use function Leuverink\PropertyAttribute\group;

it('returns multidimensional array if no methods where chained', function () {
$component = new class extends TestComponent
{
#[Group('a')]
public $foo = 1;
};

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

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();
Expand Down

0 comments on commit 32299fd

Please sign in to comment.