X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/ddb7f33868ea499ab8f48a7062f145e8c0fbe02f..refs/pull/3365/head:/tests/Unit/UrlTest.php diff --git a/tests/Unit/UrlTest.php b/tests/Unit/UrlTest.php index c2386443c..fff5414f2 100644 --- a/tests/Unit/UrlTest.php +++ b/tests/Unit/UrlTest.php @@ -1,31 +1,22 @@ -set('app.url', 'http://example.com/bookstack'); - $this->get('/'); - $this->assertEquals('http://example.com/bookstack', request()->getUri()); +namespace Tests\Unit; - config()->set('app.url', 'http://example.com/docs/content'); - $this->get('/'); - $this->assertEquals('http://example.com/docs/content', request()->getUri()); - } +use Tests\TestCase; +class UrlTest extends TestCase +{ public function test_url_helper_takes_custom_url_into_account() { - $this->runWithEnv('APP_URL', 'http://example.com/bookstack', function() { + $this->runWithEnv('APP_URL', 'http://example.com/bookstack', function () { $this->assertEquals('http://example.com/bookstack/books', url('/http/source.bookstackapp.com/books')); }); } public function test_url_helper_sets_correct_scheme_even_when_request_scheme_is_different() { - $this->runWithEnv('APP_URL', 'https://example.com/', function() { + $this->runWithEnv('APP_URL', 'https://example.com/', function () { $this->get('http://example.com/login')->assertSee('https://example.com/dist/styles.css'); }); } - -} \ No newline at end of file +}