Skip to content
This repository was archived by the owner on Nov 26, 2024. It is now read-only.

Commit 5ae9d89

Browse files
authored
Merge pull request #8 from cleaniquecoders/feature/restructure
Test
2 parents 4d50976 + 699b1f8 commit 5ae9d89

File tree

5 files changed

+80
-20
lines changed

5 files changed

+80
-20
lines changed

tests/CreatesApplication.php

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,41 @@
66

77
trait CreatesApplication
88
{
9+
/**
10+
* Setup the test environment.
11+
*/
12+
public function setUp()
13+
{
14+
parent::setUp();
15+
16+
$this->artisan('reload:db');
17+
}
18+
19+
/**
20+
* Define environment setup.
21+
*
22+
* @param \Illuminate\Foundation\Application $app
23+
* @return void
24+
*/
25+
protected function getEnvironmentSetUp($app)
26+
{
27+
// Setup default database to use sqlite :memory:
28+
$app['config']->set('database.default', 'testbench');
29+
$app['config']->set('database.connections.testbench', [
30+
'driver' => 'sqlite',
31+
'database' => ':memory:',
32+
'prefix' => '',
33+
]);
34+
}
35+
936
/**
1037
* Creates the application.
1138
*
1239
* @return \Illuminate\Foundation\Application
1340
*/
1441
public function createApplication()
1542
{
16-
$app = require __DIR__.'/../bootstrap/app.php';
43+
$app = require __DIR__ . '/../bootstrap/app.php';
1744

1845
$app->make(Kernel::class)->bootstrap();
1946

tests/Feature/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!.gitignore
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
namespace Tests\Feature;
4+
5+
use Tests\TestCase;
6+
7+
class ServiceProviderTest extends TestCase
8+
{
9+
/** @test */
10+
public function it_has_cleanique_coders_packages()
11+
{
12+
$config = config('app.providers');
13+
$providers = [
14+
\CleaniqueCoders\Blueprint\Macro\BlueprintMacroServiceProvider::class,
15+
\CleaniqueCoders\Profile\ProfileServiceProvider::class,
16+
\CleaniqueCoders\ArtisanMakers\ArtisanMakersServiceProvider::class,
17+
];
18+
foreach ($providers as $provider) {
19+
$this->assertTrue(in_array($provider, $config));
20+
}
21+
}
22+
23+
/** @test */
24+
public function it_has_spatie_packages()
25+
{
26+
$config = config('app.providers');
27+
$providers = [
28+
\Spatie\Permission\PermissionServiceProvider::class,
29+
\Spatie\Analytics\AnalyticsServiceProvider::class,
30+
\Spatie\Menu\Laravel\MenuServiceProvider::class,
31+
\Spatie\GoogleCalendar\GoogleCalendarServiceProvider::class,
32+
\Spatie\Html\HtmlServiceProvider::class,
33+
];
34+
foreach ($providers as $provider) {
35+
$this->assertTrue(in_array($provider, $config));
36+
}
37+
}
38+
39+
/** @test */
40+
public function it_has_other_packages()
41+
{
42+
$config = config('app.providers');
43+
$providers = [
44+
\UxWeb\SweetAlert\SweetAlertServiceProvider::class,
45+
];
46+
foreach ($providers as $provider) {
47+
$this->assertTrue(in_array($provider, $config));
48+
}
49+
}
50+
}

tests/Unit/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!.gitignore

tests/Unit/ExampleTest.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)