-
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to configure custom job decorator classes (#225)
- Loading branch information
1 parent
5b03bbd
commit 66c181b
Showing
9 changed files
with
112 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,32 @@ | ||
<?php | ||
|
||
use Lorisleiva\Actions\ActionManager; | ||
use Lorisleiva\Actions\Decorators\JobDecorator; | ||
use Lorisleiva\Actions\Decorators\UniqueJobDecorator; | ||
use Lorisleiva\Actions\Tests\Stubs\CustomJobDecorator; | ||
use Lorisleiva\Actions\Tests\Stubs\CustomUniqueJobDecorator; | ||
use Lorisleiva\Actions\Tests\TestCase; | ||
|
||
uses(TestCase::class)->in(__DIR__); | ||
uses(TestCase::class) | ||
->afterEach(function () { | ||
// Reset any custom job classes so they don't pollute other tests. | ||
ActionManager::useJobDecorator(JobDecorator::class); | ||
ActionManager::useUniqueJobDecorator(UniqueJobDecorator::class); | ||
}) | ||
->in(__DIR__); | ||
|
||
dataset('custom job decorators', [ | ||
'default job decorator class' => [JobDecorator::class], | ||
'custom job decorator class' => function () { | ||
ActionManager::useJobDecorator(CustomJobDecorator::class); | ||
return CustomJobDecorator::class; | ||
}, | ||
]); | ||
|
||
dataset('custom unique job decorators', [ | ||
'default job decorator class' => [UniqueJobDecorator::class], | ||
'custom job decorator class' => function () { | ||
ActionManager::useUniqueJobDecorator(CustomUniqueJobDecorator::class); | ||
return CustomUniqueJobDecorator::class; | ||
}, | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace Lorisleiva\Actions\Tests\Stubs; | ||
|
||
use Lorisleiva\Actions\Decorators\JobDecorator; | ||
|
||
class CustomJobDecorator extends JobDecorator | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace Lorisleiva\Actions\Tests\Stubs; | ||
|
||
use Lorisleiva\Actions\Decorators\UniqueJobDecorator; | ||
|
||
class CustomUniqueJobDecorator extends UniqueJobDecorator | ||
{ | ||
} |