. */ declare(strict_types=1); namespace SP\Tests\Modules\Web\Controllers\ConfigAccount; 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\IntegrationTestCase; /** * Class ConfigAccountControllerTest */ #[Group('integration')] class ConfigAccountTest extends IntegrationTestCase { /** * @throws ContainerExceptionInterface * @throws Exception * @throws NotFoundExceptionInterface */ #[Test] public function save() { $data = [ 'publiclinks_enabled' => true, 'publiclinks_image_enabled' => self::$faker->boolean(), 'publiclinks_maxtime' => self::$faker->randomNumber(4), 'publiclinks_maxviews' => self::$faker->randomNumber(4), 'files_enabled' => true, 'files_allowed_size' => self::$faker->randomNumber(3), 'files_allowed_mimetypes' => [self::$faker->mimeType(), self::$faker->mimeType()], 'account_globalsearch_enabled' => self::$faker->boolean(), 'account_passtoimage_enabled' => self::$faker->boolean(), 'account_link_enabled' => self::$faker->boolean(), 'account_fullgroup_access_enabled' => self::$faker->boolean(), 'account_count' => self::$faker->randomNumber(3), 'account_resultsascards_enabled' => self::$faker->boolean(), 'account_expire_enabled' => self::$faker->boolean(), 'account_expire_time' => self::$faker->randomNumber(8), ]; $container = $this->buildContainer( IntegrationTestCase::buildRequest('post', 'index.php', ['r' => 'configAccount/save'], $data) ); IntegrationTestCase::runApp($container); $this->expectOutputString('{"status":"OK","description":"Configuration updated","data":null}'); } }