From 05ae56e8eee8bb08f683151eb3a32b9e01ec6403 Mon Sep 17 00:00:00 2001 From: Untung Ginardi Date: Wed, 7 Sep 2016 13:56:08 +0700 Subject: [PATCH] Create unit test if request not exist should redirect to specified URL --- phpunit.xml | 2 ++ tests/IndexTest.php | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/phpunit.xml b/phpunit.xml index cebc7a2..732f0bc 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -24,5 +24,7 @@ + + diff --git a/tests/IndexTest.php b/tests/IndexTest.php index af40015..99b2a91 100644 --- a/tests/IndexTest.php +++ b/tests/IndexTest.php @@ -14,4 +14,10 @@ class IndexTest extends TestCase ->see('>Sign In') // Ensure log in buttons are shown when user is logged out ->dontSee('SQLSTATE'); // Ensure database connection is correct } + + public function testRequestGetNotExistShortUrl() { + $response = $this->call('GET', '/notexist'); + $this->assertTrue($response->isRedirection()); + $this->assertRedirectedTo(env('SETTING_NOT_EXIST_REDIRECT')); + } }