Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/DomainTest.php
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | public function tearDown(): void | ||||
foreach ($this->domains as $domain) { | foreach ($this->domains as $domain) { | ||||
$this->deleteTestDomain($domain); | $this->deleteTestDomain($domain); | ||||
} | } | ||||
parent::tearDown(); | parent::tearDown(); | ||||
} | } | ||||
/** | /** | ||||
* Test domain create/creating observer | |||||
*/ | |||||
public function testCreate(): void | |||||
{ | |||||
Queue::fake(); | |||||
$domain = Domain::create([ | |||||
'namespace' => 'GMAIL.COM', | |||||
'status' => Domain::STATUS_NEW, | |||||
'type' => Domain::TYPE_EXTERNAL, | |||||
]); | |||||
$result = Domain::where('namespace', 'gmail.com')->first(); | |||||
$this->assertSame('gmail.com', $result->namespace); | |||||
$this->assertSame($domain->id, $result->id); | |||||
$this->assertSame($domain->type, $result->type); | |||||
$this->assertSame(Domain::STATUS_NEW | Domain::STATUS_ACTIVE, $result->status); | |||||
} | |||||
/** | |||||
* Test domain creating jobs | * Test domain creating jobs | ||||
*/ | */ | ||||
public function testCreateJobs(): void | public function testCreateJobs(): void | ||||
{ | { | ||||
// Fake the queue, assert that no jobs were pushed... | // Fake the queue, assert that no jobs were pushed... | ||||
Queue::fake(); | Queue::fake(); | ||||
Queue::assertNothingPushed(); | Queue::assertNothingPushed(); | ||||
▲ Show 20 Lines • Show All 141 Lines • Show Last 20 Lines |