Test files inside module Tests/ directories (e.g. app/Mod/Lem/Tests/) extend Tests\TestCase which isn't available in production without dev dependencies. The scanner now skips /Tests/ directories and *Test.php files, and wraps class_exists() in try/catch for defence in depth. Co-Authored-By: Virgil <virgil@lethean.io>
24 lines
485 B
PHP
24 lines
485 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Core\Tests\Fixtures\Mod\Scheduled\Tests;
|
|
|
|
use Core\Actions\Action;
|
|
use Core\Actions\Scheduled;
|
|
|
|
/**
|
|
* This file lives inside a Tests/ directory to verify that the
|
|
* scanner skips test directories. Despite having #[Scheduled],
|
|
* it should never be discovered.
|
|
*/
|
|
#[Scheduled(frequency: 'everyMinute')]
|
|
class FakeScheduledTest
|
|
{
|
|
use Action;
|
|
|
|
public function handle(): string
|
|
{
|
|
return 'should-not-be-discovered';
|
|
}
|
|
}
|