Page MenuHomePhorge

DomainVerifyTest.php
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

DomainVerifyTest.php

<?php
namespace Tests\Feature\Jobs;
use App\Jobs\DomainVerify;
use App\Domain;
use Illuminate\Support\Facades\Mail;
use Tests\TestCase;
class DomainVerifyTest extends TestCase
{
/**
* {@inheritDoc}
*/
public function setUp(): void
{
parent::setUp();
$this->deleteTestDomain('gmail.com');
$this->deleteTestDomain('some-non-existing-domain.fff');
}
public function tearDown(): void
{
$this->deleteTestDomain('gmail.com');
$this->deleteTestDomain('some-non-existing-domain.fff');
parent::tearDown();
}
/**
* Test job handle (existing domain)
*
* @group dns
*/
public function testHandle(): void
{
$domain = $this->getTestDomain(
'gmail.com',
[
'status' => Domain::STATUS_NEW,
'type' => Domain::TYPE_EXTERNAL,
]
);
$this->assertFalse($domain->isVerified());
$job = new DomainVerify($domain);
$job->handle();
$this->assertTrue($domain->fresh()->isVerified());
}
/**
* Test job handle (non-existing domain)
*
* @group dns
*/
public function testHandleNonExisting(): void
{
$domain = $this->getTestDomain(
'some-non-existing-domain.fff',
[
'status' => Domain::STATUS_NEW,
'type' => Domain::TYPE_EXTERNAL,
]
);
$this->assertFalse($domain->isVerified());
$job = new DomainVerify($domain);
$job->handle();
$this->assertFalse($domain->fresh()->isVerified());
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, Apr 6, 12:38 AM (6 d, 9 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18773865
Default Alt Text
DomainVerifyTest.php (1 KB)

Event Timeline