1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 12:24:04 +00:00
tenancy/tests/Features/TimestampTest.php
Samuel Štancl 6ed68dfd7f wip
2019-11-04 12:24:20 +01:00

46 lines
1 KiB
PHP

<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Tests\Feature;
use Stancl\Tenancy\Features\Timestamps;
use Stancl\Tenancy\Tenant;
use Stancl\Tenancy\Tests\TestCase;
class TimestampTest extends TestCase
{
public $autoCreateTenant = false;
public $autoInitTenancy = false;
public function setUp(): void
{
parent::setUp();
config(['tenancy.features' => [
Timestamps::class,
]]);
}
/** @test */
public function create_and_update_timestamps_are_added_on_create()
{
$tenant = Tenant::new()->save();
$this->assertArraySubset(['created_at', 'updated_at'], $tenant->data);
}
/** @test */
public function update_timestamps_are_added()
{
$tenant = Tenant::new()->save();
$this->assertSame($tenant->created_at, $tenant->updated_at);
$this->assert($tenant->updated_at > $tenant->created_at);
}
/** @test */
public function softdelete_timestamps_are_added()
{
$this->assertSame();
}
}