-
-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # tests/BehatFeatureContextTest.php # tests/RouteTest.php Signed-off-by: crynobone <crynobone@gmail.com>
- Loading branch information
Showing
5 changed files
with
113 additions
and
4 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,93 @@ | ||
<?php | ||
|
||
namespace Orchestra\Testbench\TestCase; | ||
|
||
class DatabaseLoadMigrationsTest extends \Orchestra\Testbench\TestCase | ||
{ | ||
/** | ||
* Setup the test environment. | ||
*/ | ||
public function setUp() | ||
{ | ||
parent::setUp(); | ||
|
||
// uncomment to enable route filters if your package defines routes with filters | ||
// $this->app['router']->enableFilters(); | ||
|
||
// call migrations for packages upon which our package depends, e.g. Cartalyst/Sentry | ||
// not necessary if your package doesn't depend on another package that requires | ||
// running migrations for proper installation | ||
/* uncomment as necessary | ||
$this->artisan('migrate', [ | ||
'--database' => 'testbench', | ||
'--path' => '../vendor/cartalyst/sentry/src/migrations', | ||
]); | ||
*/ | ||
$this->loadMigrationsFrom(realpath(__DIR__.'/migrations')); | ||
} | ||
|
||
/** | ||
* Define environment setup. | ||
* | ||
* @param \Illuminate\Foundation\Application $app | ||
* | ||
* @return void | ||
*/ | ||
protected function getEnvironmentSetUp($app) | ||
{ | ||
$app['config']->set('database.default', 'testing'); | ||
} | ||
|
||
/** | ||
* Get package providers. At a minimum this is the package being tested, but also | ||
* would include packages upon which our package depends, e.g. Cartalyst/Sentry | ||
* In a normal app environment these would be added to the 'providers' array in | ||
* the config/app.php file. | ||
* | ||
* @param \Illuminate\Foundation\Application $app | ||
* | ||
* @return array | ||
*/ | ||
protected function getPackageProviders($app) | ||
{ | ||
return [ | ||
//'Cartalyst\Sentry\SentryServiceProvider', | ||
//'YourProject\YourPackage\YourPackageServiceProvider', | ||
]; | ||
} | ||
|
||
/** | ||
* Get package aliases. In a normal app environment these would be added to | ||
* the 'aliases' array in the config/app.php file. If your package exposes an | ||
* aliased facade, you should add the alias here, along with aliases for | ||
* facades upon which your package depends, e.g. Cartalyst/Sentry. | ||
* | ||
* @param \Illuminate\Foundation\Application $app | ||
* | ||
* @return array | ||
*/ | ||
protected function getPackageAliases($app) | ||
{ | ||
return [ | ||
//'Sentry' => 'Cartalyst\Sentry\Facades\Laravel\Sentry', | ||
//'YourPackage' => 'YourProject\YourPackage\Facades\YourPackage', | ||
]; | ||
} | ||
|
||
/** | ||
* Test running migration. | ||
* | ||
* @test | ||
*/ | ||
public function testRunningMigration() | ||
{ | ||
$users = \DB::table('users')->where('id', '=', 1)->first(); | ||
|
||
$this->assertEquals('hello@orchestraplatform.com', $users->email); | ||
$this->assertTrue(\Hash::check('123', $users->password)); | ||
|
||
$this->beforeApplicationDestroyed(function () { | ||
$this->assertSame(\Schema::hasTable('users'), false); | ||
}); | ||
} | ||
} |
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