1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Fixed redirect issue when custom app url in use

Fixes #956 & #1048
Also added tests to cover this url logic.
Also removed debugbar during tests to maybe improve test speed.
This commit is contained in:
Dan Brown
2018-11-04 15:18:27 +00:00
parent 7799ba5c79
commit 19b7093438
3 changed files with 26 additions and 1 deletions

19
tests/HelpersTest.php Normal file
View File

@ -0,0 +1,19 @@
<?php namespace Tests;
class HelpersTest extends TestCase
{
public function test_base_url_takes_config_into_account()
{
config()->set('app.url', 'http://example.com/bookstack');
$result = baseUrl('/');
$this->assertEquals('http://example.com/bookstack/', $result);
}
public function test_base_url_takes_extra_path_into_account_on_forced_domain()
{
config()->set('app.url', 'http://example.com/bookstack');
$result = baseUrl('http://example.com/bookstack/', true);
$this->assertEquals('http://example.com/bookstack/', $result);
}
}