Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- [x] Checks uri and response code without needing server (smoke tests)
- Loading branch information
Geshan Manandhar
committed
Oct 4, 2015
1 parent
198016c
commit 04baf61
Showing
3 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace Test\Integrated; | ||
|
||
use Illuminate\Foundation\Testing\WithoutMiddleware; | ||
use Illuminate\Foundation\Testing\DatabaseMigrations; | ||
use Illuminate\Foundation\Testing\DatabaseTransactions; | ||
use Test\TestCase; | ||
|
||
class ExampleTest extends TestCase | ||
{ | ||
/** | ||
* A basic functional test example. | ||
* | ||
* @return void | ||
*/ | ||
public function testBasicExample() | ||
{ | ||
$this->visit('/') | ||
->see('Laravel 5'); | ||
} | ||
|
||
public function providerAllUrisWithResponseCode() | ||
{ | ||
return [ | ||
['/', 200], | ||
['/place/cc', 200], | ||
['/place/cod', 200], | ||
['/non-existing', 404], | ||
]; | ||
} | ||
|
||
/** | ||
* This is kind of a smoke test | ||
* | ||
* @dataProvider providerAllUrisWithResponseCode | ||
**/ | ||
public function testApplicationUriResponses($uri, $responseCode) | ||
{ | ||
print sprintf('checking URI : %s - to be %d - %s', $uri, $responseCode, PHP_EOL); | ||
$response = $this->call('GET', $uri); | ||
|
||
$this->assertEquals($responseCode, $response->status()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters