Skip to content

Commit

Permalink
Fix test naming
Browse files Browse the repository at this point in the history
  • Loading branch information
cjonstrup committed Mar 14, 2024
1 parent 62e5c70 commit 6ea7f34
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
.DS_Store?
ehthumbs.db
Thumbs.db
.phpunit.cache

# IDE
*.sublime-*
Expand All @@ -19,3 +20,4 @@ composer.lock
docs
vendor
.phpunit.result.cache

2 changes: 1 addition & 1 deletion tests/HelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Appstract\Options\Option;

class HelperTest extends BaseTest
final class HelperTest extends TestCase
{
/** @test */
public function it_can_get_instance()
Expand Down
35 changes: 16 additions & 19 deletions tests/BaseTest.php → tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,24 @@

use Appstract\Options\OptionFacade;
use Appstract\Options\OptionsServiceProvider;
use Orchestra\Testbench\TestCase;
use Illuminate\Foundation\Application;
use Orchestra\Testbench\TestCase as Orchestra;

abstract class BaseTest extends TestCase
abstract class TestCase extends Orchestra
{
public function setUp(): void
{
parent::setUp();

$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
}

/**
* Define environment setup.
*
* @param \Illuminate\Foundation\Application $app
* @return void
* @param Application $app
*/
protected function getEnvironmentSetUp($app)
protected function getEnvironmentSetUp($app): void
{
// Setup default database to use sqlite :memory:
$app['config']->set('database.default', 'testbench');
Expand All @@ -28,23 +35,13 @@ protected function getEnvironmentSetUp($app)
);
}

/**
* Setup the test environment.
*/
public function setUp(): void
{
parent::setUp();

$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
}

/**
* Get package providers.
*
* @param \Illuminate\Foundation\Application $app
* @param Application $app
* @return array
*/
protected function getPackageProviders($app)
protected function getPackageProviders($app): array
{
return [
OptionsServiceProvider::class,
Expand All @@ -54,10 +51,10 @@ protected function getPackageProviders($app)
/**
* Get package aliases.
*
* @param \Illuminate\Foundation\Application $app
* @param Application $app
* @return array
*/
protected function getPackageAliases($app)
protected function getPackageAliases($app): array
{
return [
'Option' => OptionFacade::class,
Expand Down

0 comments on commit 6ea7f34

Please sign in to comment.