Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvanassche committed Sep 21, 2023
1 parent 4bccae7 commit 1cab4a5
Showing 1 changed file with 27 additions and 31 deletions.
58 changes: 27 additions & 31 deletions tests/PartialsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
it('can include a lazy property', function () {
$data = new LazyData(Lazy::create(fn () => 'test'));

// expect($data->toArray())->toBe([]);
expect($data->toArray())->toBe([]);

expect($data->include('name')->toArray())
->toMatchArray([
Expand Down Expand Up @@ -66,39 +66,35 @@ public function __construct(

expect((clone $data)->toArray())->toBe([]);

expect((clone $data)->include('data')->toArray())
->toMatchArray([
'data' => [],
]);
expect((clone $data)->include('data')->toArray())->toMatchArray([
'data' => [],
]);

expect((clone $data)->include('data.name')->toArray())
->toMatchArray([
'data' => ['name' => 'Hello'],
]);
expect((clone $data)->include('data.name')->toArray())->toMatchArray([
'data' => ['name' => 'Hello'],
]);

expect((clone $data)->include('collection')->toArray())
->toMatchArray([
'collection' => [
[],
[],
[],
[],
[],
[],
],
]);
expect((clone $data)->include('collection')->toArray())->toMatchArray([
'collection' => [
[],
[],
[],
[],
[],
[],
],
]);

expect((clone $data)->include('collection.name')->toArray())
->toMatchArray([
'collection' => [
['name' => 'is'],
['name' => 'it'],
['name' => 'me'],
['name' => 'your'],
['name' => 'looking'],
['name' => 'for'],
],
]);
expect((clone $data)->include('collection.name')->toArray())->toMatchArray([
'collection' => [
['name' => 'is'],
['name' => 'it'],
['name' => 'me'],
['name' => 'your'],
['name' => 'looking'],
['name' => 'for'],
],
]);
});

it('can include specific nested data', function () {
Expand Down

0 comments on commit 1cab4a5

Please sign in to comment.