Add str_replace(DIRECTORY_SEPARATOR, '/'

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
Kamil Tekiela 2026-02-20 15:28:54 +00:00
parent 86eeab53bf
commit 2c161c14cf
2 changed files with 2 additions and 7 deletions

View File

@ -238,7 +238,7 @@ class Error extends Message
*/
public function getFile(): string
{
return $this->file;
return str_replace(DIRECTORY_SEPARATOR, '/', $this->file);
}
/**

View File

@ -9,9 +9,6 @@ use PhpMyAdmin\Tests\AbstractTestCase;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use function str_replace;
use const DIRECTORY_SEPARATOR;
use const E_COMPILE_ERROR;
use const E_COMPILE_WARNING;
use const E_CORE_ERROR;
@ -81,9 +78,7 @@ class ErrorTest extends AbstractTestCase
{
$this->object->setFile($file);
$filePath = $this->object->getFile();
self::assertStringStartsWith('.' . DIRECTORY_SEPARATOR, $filePath);
/** @psalm-var non-empty-string $expected */
$expected = str_replace('/', DIRECTORY_SEPARATOR, $expected);
self::assertStringStartsWith('./', $filePath);
self::assertStringEndsWith($expected, $filePath);
}