1
0
mirror of https://github.com/cydrobolt/polr.git synced 2024-09-19 15:11:40 +02:00

Create unit test if request not exist should redirect to specified URL

This commit is contained in:
Untung Ginardi 2016-09-07 13:56:08 +07:00
parent 5edaf41346
commit 05ae56e8ee
2 changed files with 8 additions and 0 deletions

View File

@ -24,5 +24,7 @@
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<env name="SETTING_REDIRECT_URL_NOT_EXIST" value="true"/>
<env name="SETTING_NOT_EXIST_REDIRECT" value="http://redirect.polr.me/"/>
</php>
</phpunit>

View File

@ -14,4 +14,10 @@ class IndexTest extends TestCase
->see('>Sign In</a>') // 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'));
}
}