Skip to content

Commit fd50e64

Browse files
committed
Fix failing test ApiUserCest.php:testMyPostsListAction WIP
1 parent dccb6ce commit fd50e64

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

tests/testapp/transformers/CommentTransformer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class CommentTransformer extends TransformerAbstract
99
{
10-
public $availableIncludes = ['post'];
10+
public array $availableIncludes = ['post'];
1111

1212
public function transform(Comment $comment):array
1313
{

tests/testapp/transformers/PostShortTransformer.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class PostShortTransformer extends TransformerAbstract
1414
{
15-
protected $availableIncludes = [
15+
protected array $availableIncludes = [
1616
'author', 'category'
1717
];
1818

@@ -26,8 +26,8 @@ public function includeAuthor(Post $post): Item
2626
$author = $post->author;
2727

2828
return $this->item($author, function(User $author){
29-
return $author->getAttributes(['id', 'username', 'email', 'created_at']);
30-
}, 'users') + ['links'=>['self'=>'/users/'.$author->id]];
29+
return $author->getAttributes(['id', 'username', 'email', 'created_at']) + ['links'=>['self'=>'/users/'.$author->id]];
30+
}, 'users');
3131
}
3232

3333

tests/testapp/transformers/PostTransformer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
class PostTransformer extends TransformerAbstract
1515
{
16-
protected $availableIncludes = [
16+
protected array $availableIncludes = [
1717
'author', 'category', 'comments'
1818
];
1919

tests/testapp/transformers/UserExtendTransformer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ class UserExtendTransformer extends TransformerAbstract
1313
* Resources that can be included if requested.
1414
* @var array
1515
*/
16-
protected $availableIncludes = ['comments'];
16+
protected array $availableIncludes = ['comments'];
1717

1818
/**
1919
* Include resources without needing it to be requested.
2020
* @var array
2121
*/
22-
protected $defaultIncludes = ['posts'];
22+
protected array $defaultIncludes = ['posts'];
2323

2424
public function transform(User $user)
2525
{

0 commit comments

Comments
 (0)