-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from GeneaLabs/feature/implement-orchestral-te…
…stsuite Get all existing tests converted to Orchestral
- Loading branch information
Showing
17 changed files
with
112 additions
and
87 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/tests/Browser/console | ||
/tests/Browser/screenshots | ||
/vendor | ||
composer.lock |
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
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
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,16 @@ | ||
<?php namespace GeneaLabs\LaravelCaffeine\Tests\Browser; | ||
|
||
use GeneaLabs\LaravelCaffeine\Tests\BrowserTestCase; | ||
use Laravel\Dusk\Browser; | ||
|
||
class DripTest extends BrowserTestCase | ||
{ | ||
public function testFormDoesntExpire() | ||
{ | ||
$this->browse(function (Browser $browser) { | ||
$response = $browser->visit('tests/form'); | ||
|
||
$response->assertSee('Test Form'); | ||
}); | ||
} | ||
} |
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,18 @@ | ||
<?php namespace GeneaLabs\LaravelCaffeine\Tests; | ||
|
||
use Orchestra\Testbench\Dusk\TestCase as BaseTestCase; | ||
|
||
abstract class BrowserTestCase extends BaseTestCase | ||
{ | ||
use CreatesApplication; | ||
|
||
public static function setUpBeforeClass() | ||
{ | ||
static::serve(); | ||
} | ||
|
||
public static function tearDownAfterClass() | ||
{ | ||
static::stopServing(); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,25 +1,14 @@ | ||
<?php namespace GeneaLabs\LaravelCaffeine\Tests; | ||
|
||
use GeneaLabs\LaravelCaffeine\Providers\Service as LaravelCaffeineService; | ||
use Illuminate\Contracts\Console\Kernel; | ||
|
||
trait CreatesApplication | ||
{ | ||
public function createApplication() | ||
/** | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) | ||
*/ | ||
protected function getPackageProviders($app) | ||
{ | ||
$this->loadRoutes(); | ||
$app = require __DIR__ . '/../vendor/laravel/laravel/bootstrap/app.php'; | ||
$app->make(Kernel::class)->bootstrap(); | ||
$app->register(LaravelCaffeineService::class); | ||
|
||
return $app; | ||
} | ||
|
||
protected function loadRoutes() | ||
{ | ||
$routes = file_get_contents(__DIR__ . '/../routes/web.php'); | ||
$routes .= str_replace('<?php', '', file_get_contents(__DIR__ . '/../tests/routes/web.php')); | ||
|
||
file_put_contents(__DIR__ . '/../vendor/laravel/laravel/routes/web.php', $routes); | ||
return [LaravelCaffeineService::class]; | ||
} | ||
} |
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,8 @@ | ||
<?php namespace GeneaLabs\LaravelCaffeine\Tests; | ||
|
||
use Orchestra\Testbench\BrowserKit\TestCase as BaseTestCase; | ||
|
||
abstract class FeatureTestCase extends BaseTestCase | ||
{ | ||
use CreatesApplication; | ||
} |
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
<?php namespace GeneaLabs\LaravelCaffeine\Tests; | ||
|
||
use Orchestra\Testbench\TestCase as BaseTestCase; | ||
|
||
abstract class UnitTestCase extends BaseTestCase | ||
{ | ||
use CreatesApplication; | ||
} |
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 |
---|---|---|
@@ -1,21 +1,20 @@ | ||
<?php | ||
|
||
use GeneaLabs\LaravelCaffeine\Tests\Http\Controllers\Test; | ||
|
||
Route::group([ | ||
'middleware' => ['web'], | ||
'as' => 'genealabs-laravel-caffeine.', | ||
'prefix' => 'tests' | ||
'prefix' => 'tests', | ||
'namespace' => 'GeneaLabs\LaravelCaffeine\Tests\Http\Controllers', | ||
], function () { | ||
Route::any('form', Test::class . '@drippedForm') | ||
Route::any('form', 'Test@drippedForm') | ||
->name('tests.form'); | ||
Route::any('dripped-form', Test::class . '@drippedForm'); | ||
Route::any('expiring-form', Test::class . '@expiredForm'); | ||
Route::any('disabled-page', Test::class . '@disabledPage') | ||
Route::any('dripped-form', 'Test@drippedForm'); | ||
Route::any('expiring-form', 'Test@expiredForm'); | ||
Route::any('disabled-page', 'Test@disabledPage') | ||
->name('tests.disabled-page'); | ||
Route::any('null-response', Test::class . '@nullResponse') | ||
Route::any('null-response', 'Test@nullResponse') | ||
->name('tests.null-response'); | ||
Route::any('route-middleware', Test::class . '@drippedForm') | ||
Route::any('route-middleware', 'Test@drippedForm') | ||
->name('tests.route-middleware') | ||
->middleware('caffeinated'); | ||
}); |