This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into different-worker-types
- Loading branch information
Showing
5 changed files
with
64 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Spiral\RoadRunnerLaravel\Listeners; | ||
|
||
use Tightenco\Ziggy\BladeRouteGenerator; | ||
|
||
/** | ||
* Target package: <https://github.com/tighten/ziggy>. | ||
*/ | ||
class ResetZiggyListener implements ListenerInterface | ||
{ | ||
use Traits\InvokerTrait; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function handle($event): void | ||
{ | ||
if (!\class_exists(BladeRouteGenerator::class)) { | ||
return; | ||
} | ||
|
||
BladeRouteGenerator::$generated = false; | ||
} | ||
} |
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,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Spiral\RoadRunnerLaravel\Tests\Unit\Listeners; | ||
|
||
use Tightenco\Ziggy\BladeRouteGenerator; | ||
use Spiral\RoadRunnerLaravel\Listeners\ResetZiggyListener; | ||
|
||
/** | ||
* @covers \Spiral\RoadRunnerLaravel\Listeners\ResetZiggyListener | ||
*/ | ||
class ResetZiggyListenerTest extends AbstractListenerTestCase | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function testHandle(): void | ||
{ | ||
BladeRouteGenerator::$generated = true; | ||
|
||
$this->listenerFactory()->handle(new \stdClass()); | ||
|
||
$this->assertFalse(BladeRouteGenerator::$generated); | ||
} | ||
|
||
/** | ||
* @return ResetZiggyListener | ||
*/ | ||
protected function listenerFactory(): ResetZiggyListener | ||
{ | ||
return new ResetZiggyListener(); | ||
} | ||
} |