mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 20:34:03 +00:00
Update MaintenanceModeTest.php
This commit is contained in:
parent
f430cd7afc
commit
e009ce9ad6
1 changed files with 14 additions and 6 deletions
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Stancl\Tenancy\Tests;
|
namespace Stancl\Tenancy\Tests;
|
||||||
|
|
||||||
use Illuminate\Foundation\Http\Exceptions\MaintenanceModeException;
|
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
use Stancl\Tenancy\Database\Concerns\MaintenanceMode;
|
use Stancl\Tenancy\Database\Concerns\MaintenanceMode;
|
||||||
use Stancl\Tenancy\Middleware\CheckTenantForMaintenanceMode;
|
use Stancl\Tenancy\Middleware\CheckTenantForMaintenanceMode;
|
||||||
|
|
@ -32,16 +31,25 @@ class MaintenanceModeTest extends TestCase
|
||||||
|
|
||||||
$tenant->putDownForMaintenance();
|
$tenant->putDownForMaintenance();
|
||||||
|
|
||||||
$this->expectException(MaintenanceModeException::class);
|
$this->get('http://acme.localhost/foo')
|
||||||
$this->withoutExceptionHandling()
|
->assertStatus(503);
|
||||||
->get('http://acme.localhost/foo');
|
|
||||||
|
tenancy()->end();
|
||||||
|
|
||||||
$tenant->bringUpFromMaintenance();
|
$tenant->bringUpFromMaintenance();
|
||||||
|
|
||||||
$this->withoutExceptionHandling()
|
tenancy()->end();
|
||||||
->get('http://acme.localhost/foo')
|
|
||||||
|
$this->get('http://acme.localhost/foo')
|
||||||
|
->assertSuccessful()
|
||||||
->assertSeeText('bar');
|
->assertSeeText('bar');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @test */
|
||||||
|
public function tenant_can_be_in_maintenance_mode_from_command()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MaintenanceTenant extends Tenant
|
class MaintenanceTenant extends Tenant
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue