mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-19 17:34:45 +02:00

* chore: yarn upgrade * chore: composer upgrade * chore: php artisan filament:upgrade * chore: update filament-monaco-editor-views * chore: update filament-monaco-editor-configs * chore: move turnstile-views to plugins * fix monaco-editor loader & css
44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Tests\Unit\Helpers;
|
|
|
|
use App\Tests\TestCase;
|
|
use App\Traits\EnvironmentWriterTrait;
|
|
use PHPUnit\Framework\Attributes\DataProvider;
|
|
|
|
class EnvironmentWriterTraitTest extends TestCase
|
|
{
|
|
#[DataProvider('variableDataProvider')]
|
|
public function test_variable_is_escaped_properly($input, $expected): void
|
|
{
|
|
$output = (new FooClass())->escapeEnvironmentValue($input);
|
|
|
|
$this->assertSame($expected, $output);
|
|
}
|
|
|
|
public static function variableDataProvider(): array
|
|
{
|
|
return [
|
|
['foo', 'foo'],
|
|
['abc123', 'abc123'],
|
|
['val"ue', '"val\"ue"'],
|
|
['val\'ue', '"val\'ue"'],
|
|
['my test value', '"my test value"'],
|
|
['mysql_p@assword', '"mysql_p@assword"'],
|
|
['mysql_p#assword', '"mysql_p#assword"'],
|
|
['mysql p@$$word', '"mysql p@$$word"'],
|
|
['mysql p%word', '"mysql p%word"'],
|
|
['mysql p#word', '"mysql p#word"'],
|
|
['abc_@#test', '"abc_@#test"'],
|
|
['test 123 $$$', '"test 123 $$$"'],
|
|
['#password%', '"#password%"'],
|
|
['$pass ', '"$pass "'],
|
|
];
|
|
}
|
|
}
|
|
|
|
class FooClass
|
|
{
|
|
use EnvironmentWriterTrait;
|
|
}
|