-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04ff95e
commit d8fccef
Showing
17 changed files
with
320 additions
and
38 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
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,36 @@ | ||
<?php | ||
|
||
use Arcanesoft\Foundation\Auth\Auth; | ||
use Faker\Generator as Faker; | ||
use Illuminate\Support\Str; | ||
|
||
$userModel = Auth::model('user', Arcanesoft\Foundation\Auth\Models\User::class); | ||
|
||
/** @var Illuminate\Database\Eloquent\Factory $factory */ | ||
|
||
$factory->define($userModel, function (Faker $faker) { | ||
return [ | ||
'first_name' => $faker->firstName, | ||
'last_name' => $faker->lastName, | ||
'email' => $faker->unique()->safeEmail, | ||
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret | ||
'remember_token' => Str::random(10), | ||
]; | ||
}); | ||
|
||
/* ----------------------------------------------------------------- | ||
| States | ||
| ----------------------------------------------------------------- | ||
*/ | ||
|
||
$factory->state($userModel, 'email-verified', [ | ||
'email_verified_at' => now(), | ||
]); | ||
|
||
$factory->state($userModel, 'activated', [ | ||
'activated_at' => now(), | ||
]); | ||
|
||
$factory->state($userModel, 'super-admin', [ | ||
'is_admin' => true, | ||
]); |
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
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,17 @@ | ||
<?php | ||
|
||
namespace Arcanesoft\Foundation\Tests\Stubs\Models; | ||
|
||
use Arcanesoft\Foundation\Auth\Models\User as Authenticatable; | ||
use Illuminate\Contracts\Auth\MustVerifyEmail; | ||
|
||
/** | ||
* Class User | ||
* | ||
* @package Arcanesoft\Foundation\Tests\Stubs\Models | ||
* @author ARCANEDEV <arcanedev.maroc@gmail.com> | ||
*/ | ||
class User extends Authenticatable implements MustVerifyEmail | ||
{ | ||
// | ||
} |
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,70 @@ | ||
<?php | ||
|
||
namespace Arcanesoft\Foundation\Tests; | ||
|
||
use Orchestra\Testbench\TestCase as OrchestraTestCase; | ||
|
||
/** | ||
* Class TestCase | ||
* | ||
* @package Arcanesoft\Foundation\Tests | ||
* @author ARCANEDEV <arcanedev.maroc@gmail.com> | ||
*/ | ||
abstract class TestCase extends OrchestraTestCase | ||
{ | ||
/* ----------------------------------------------------------------- | ||
| Main Methods | ||
| ----------------------------------------------------------------- | ||
*/ | ||
|
||
/** | ||
* Get package providers. | ||
* | ||
* @param \Illuminate\Foundation\Application $app | ||
* | ||
* @return array | ||
*/ | ||
protected function getPackageProviders($app) | ||
{ | ||
return [ | ||
// Main Provider | ||
\Arcanesoft\Foundation\FoundationServiceProvider::class, | ||
|
||
// Dependencies | ||
\Arcanedev\LaravelImpersonator\ImpersonatorServiceProvider::class, | ||
\Arcanedev\LaravelPolicies\PoliciesServiceProvider::class, | ||
\Arcanedev\LaravelMetrics\MetricServiceProvider::class, | ||
\Arcanedev\Notify\NotifyServiceProvider::class, | ||
]; | ||
} | ||
|
||
/** | ||
* Define environment setup. | ||
* | ||
* @param \Illuminate\Foundation\Application $app | ||
*/ | ||
protected function getEnvironmentSetUp($app): void | ||
{ | ||
// Configuration | ||
$app['config']->set( | ||
'arcanesoft.foundation.auth.database.models.user', | ||
Stubs\Models\User::class | ||
); | ||
} | ||
|
||
/** | ||
* Load the migrations. | ||
*/ | ||
protected function loadMigrations(): void | ||
{ | ||
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); | ||
} | ||
|
||
/** | ||
* Load the factories. | ||
*/ | ||
protected function loadFactories(): void | ||
{ | ||
$this->withFactories(__DIR__.'/../database/factories'); | ||
} | ||
} |
Empty file.
Oops, something went wrong.