Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Actions/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abstract class Action extends RestController implements JsonSerializable

public static function indexQuery(RestifyRequest $request, $query)
{
//
//
}

/**
Expand Down
15 changes: 6 additions & 9 deletions tests/Actions/PerformActionsControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
namespace Binaryk\LaravelRestify\Tests\Actions;

use Binaryk\LaravelRestify\Actions\Action;
use Binaryk\LaravelRestify\Http\Requests\ActionRequest;
use Binaryk\LaravelRestify\Tests\Fixtures\Post\Post;
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PostRepository;
use Binaryk\LaravelRestify\Tests\Fixtures\Post\PublishPostAction;
use Binaryk\LaravelRestify\Tests\Fixtures\User\ActivateAction;
Expand All @@ -25,7 +23,7 @@ public function test_could_perform_action_for_multiple_repositories()
{
$post = $this->mockPosts(1, 2);

$this->post('posts/action?action=' . (new PublishPostAction())->uriKey(), [
$this->post('posts/action?action='.(new PublishPostAction())->uriKey(), [
'repositories' => [
$post->first()->id,
$post->last()->id,
Expand Down Expand Up @@ -57,15 +55,14 @@ public function handle(Request $request, Collection $collection)
'fromHandle' => $collection->count(),
]);
}
}
},
]);

$this->post('posts/action?action=publish', [
'repositories' => 'all'
'repositories' => 'all',
])->assertOk()->assertJsonFragment([
'fromHandle' => 0,
]);

}

public function test_cannot_apply_a_show_action_to_index()
Expand All @@ -75,7 +72,7 @@ public function test_cannot_apply_a_show_action_to_index()
$_SERVER['actions.posts.invalidate'] = true;
$_SERVER['actions.posts.publish.onlyOnShow'] = true;

$this->post('posts/action?action=' . (new PublishPostAction())->uriKey(), [
$this->post('posts/action?action='.(new PublishPostAction())->uriKey(), [
'repositories' => [
$post->first()->id,
$post->last()->id,
Expand All @@ -91,7 +88,7 @@ public function test_show_action_not_need_repositories()
{
$users = $this->mockUsers();

$this->post('users/' . $users->first()->id . '/action?action=' . (new ActivateAction)->uriKey())
$this->post('users/'.$users->first()->id.'/action?action='.(new ActivateAction)->uriKey())
->assertSuccessful()
->assertJsonStructure([
'data',
Expand All @@ -102,7 +99,7 @@ public function test_show_action_not_need_repositories()

public function test_could_perform_standalone_action()
{
$this->post('users/action?action=' . (new DisableProfileAction())->uriKey())
$this->post('users/action?action='.(new DisableProfileAction())->uriKey())
->assertSuccessful()
->assertJsonStructure([
'data',
Expand Down