1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 11:14:03 +00:00

Add DatabaseCreationTest

This commit is contained in:
Samuel Štancl 2019-02-07 17:38:00 +01:00
parent c71e639767
commit f993308b16
8 changed files with 128 additions and 50 deletions

View file

@ -0,0 +1,38 @@
<?php
namespace Stancl\Tenancy\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Stancl\Tenancy\Interfaces\DatabaseCreator;
class QueuedDatabaseCreator implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Create a new job instance.
*
* @param DatabaseCreator $databaseCreator
* @param string $databaseName
* @return void
*/
public function __construct(DatabaseCreator $databaseCreator, string $databaseName)
{
$this->databaseCreator = $databaseCreator;
$this->databaseName = $databaseName;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
$this->databaseCreator->createDatabase($databaseName);
}
}