A warning was shown due to the cwd being changed into a location which
was then later deleted. This resets the cwd before running the deletion.
$this->assertStringEqualsFile('/var/www/bookstack-symlink-restore/storage/uploads/test.txt', 'hello-storage-uploads');
$this->assertStringEqualsFile('/var/www/bookstack-symlink-restore/themes/test.txt', 'hello-themes');
+ $this->resetCurrentDirectory();
exec('rm -rf /var/www/bookstack-symlink-restore');
exec('rm -rf /symlinks');
}
class TestCase extends \PHPUnit\Framework\TestCase
{
+ /**
+ * Reset the current working directory to the application directory.
+ */
+ protected function resetCurrentDirectory(): void
+ {
+ chdir(dirname(__DIR__));
+ }
+
protected function getTestDataDirectory(): string
{
return dirname(__DIR__) . DIRECTORY_SEPARATOR . 'test-data';