. */ declare(strict_types=1); namespace SP\Tests\Modules\Web\Controllers\Bootstrap; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\MockObject\Exception; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use SP\Tests\BodyChecker; use SP\Tests\IntegrationTestCase; /** * Class BootstrapTest */ #[Group('integration')] class BootstrapTest extends IntegrationTestCase { /** * @throws ContainerExceptionInterface * @throws Exception * @throws NotFoundExceptionInterface */ #[Test] #[BodyChecker('getEnvironmentOutputChecker')] public function getEnvironment() { $container = $this->buildContainer( IntegrationTestCase::buildRequest('get', 'index.php', ['r' => 'bootstrap/getEnvironment']) ); IntegrationTestCase::runApp($container); } public function getEnvironmentOutputChecker(string $output): void { $json = json_decode($output); $properties = [ 'lang', 'locale', 'app_root', 'max_file_size', 'check_updates', 'check_notices', 'check_notifications', 'timezone', 'debug', 'cookies_enabled', 'plugins', 'loggedin', 'authbasic_autologin', 'pki_key', 'pki_max_size', 'import_allowed_mime', 'files_allowed_mime', 'session_timeout', 'csrf', ]; self::assertCount(count($properties), (array)$json->data); foreach ($properties as $property) { self::assertObjectHasProperty($property, $json->data); } } }