Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 8m4s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 8m17s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 8m45s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 8m49s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 11m16s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 11m23s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 10m7s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 45s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 9m48s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m15s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
45 lines
1.3 KiB
PHP
45 lines
1.3 KiB
PHP
<?php
|
||
|
||
namespace Tests;
|
||
|
||
use App\Plugins\PluginState;
|
||
use App\Support\Update\MaintenanceFlag;
|
||
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
||
use Illuminate\Testing\TestResponse;
|
||
|
||
abstract class TestCase extends BaseTestCase
|
||
{
|
||
public function createApplication()
|
||
{
|
||
// Optionale mitgelieferte Plugins (z. B. Geburtstage) in Tests mitladen.
|
||
PluginState::$enableOptionalCorePlugins = true;
|
||
|
||
return parent::createApplication();
|
||
}
|
||
|
||
protected function setUp(): void
|
||
{
|
||
parent::setUp();
|
||
|
||
// Wartungsmodus und Update-Zeiträume nie im echten storage/ – und je Test frisch
|
||
$this->app->instance(MaintenanceFlag::class, new MaintenanceFlag(sys_get_temp_dir().'/inhaus-test-'.bin2hex(random_bytes(4)).'.maintenance'));
|
||
}
|
||
|
||
/**
|
||
* Props einer Startseiten-Kachel (oder null, wenn sie nicht angezeigt wird).
|
||
*
|
||
* @return array<string, mixed>|null
|
||
*/
|
||
protected function dashboardWidget(TestResponse $response, string $key): ?array
|
||
{
|
||
$widgets = $response->viewData('page')['props']['widgets'] ?? [];
|
||
|
||
foreach ($widgets as $widget) {
|
||
if ($widget['key'] === $key) {
|
||
return $widget['props'];
|
||
}
|
||
}
|
||
|
||
return null;
|
||
}
|
||
}
|