mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-10 05:06:56 +08:00
Updated update-url command to look at setting values
For #2546 Need to consider new JSON-array based setting values.
This commit is contained in:
@ -60,6 +60,7 @@ class UpdateUrl extends Command
|
|||||||
"attachments" => ["path"],
|
"attachments" => ["path"],
|
||||||
"pages" => ["html", "text", "markdown"],
|
"pages" => ["html", "text", "markdown"],
|
||||||
"images" => ["url"],
|
"images" => ["url"],
|
||||||
|
"settings" => ["value"],
|
||||||
"comments" => ["html", "text"],
|
"comments" => ["html", "text"],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
use BookStack\Actions\ActivityType;
|
use BookStack\Actions\ActivityType;
|
||||||
use BookStack\Actions\Comment;
|
use BookStack\Actions\Comment;
|
||||||
use BookStack\Actions\CommentRepo;
|
|
||||||
use BookStack\Auth\Permissions\JointPermission;
|
use BookStack\Auth\Permissions\JointPermission;
|
||||||
use BookStack\Entities\Models\Bookshelf;
|
use BookStack\Entities\Models\Bookshelf;
|
||||||
use BookStack\Entities\Models\Page;
|
use BookStack\Entities\Models\Page;
|
||||||
@ -198,6 +197,17 @@ class CommandsTest extends TestCase
|
|||||||
$this->artisan('bookstack:update-url https://cats.example.com');
|
$this->artisan('bookstack:update-url https://cats.example.com');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_update_url_command_updates_settings()
|
||||||
|
{
|
||||||
|
setting()->put('my-custom-item', 'https://example.com/donkey/cat');
|
||||||
|
$this->artisan('bookstack:update-url https://example.com https://cats.example.com')
|
||||||
|
->expectsQuestion("This will search for \"https://example.com\" in your database and replace it with \"https://cats.example.com\".\nAre you sure you want to proceed?", 'y')
|
||||||
|
->expectsQuestion("This operation could cause issues if used incorrectly. Have you made a backup of your existing database?", 'y');
|
||||||
|
|
||||||
|
$settingVal = setting('my-custom-item');
|
||||||
|
$this->assertEquals('https://cats.example.com/donkey/cat', $settingVal);
|
||||||
|
}
|
||||||
|
|
||||||
public function test_regenerate_comment_content_command()
|
public function test_regenerate_comment_content_command()
|
||||||
{
|
{
|
||||||
Comment::query()->forceCreate([
|
Comment::query()->forceCreate([
|
||||||
|
Reference in New Issue
Block a user