Page MenuHomePhorge

VerifyTest.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

VerifyTest.php

<?php
namespace Tests\Feature\Jobs\Domain;
use App\Domain;
use Tests\TestCase;
class VerifyTest 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 \App\Jobs\Domain\VerifyJob($domain->id);
$job->handle();
$this->assertTrue($domain->fresh()->isVerified());
// Test non-existing domain ID
$job = new \App\Jobs\Domain\VerifyJob(123);
$job->handle();
$this->assertTrue($job->hasFailed());
$this->assertSame("Domain 123 could not be found in the database.", $job->failureMessage);
}
/**
* 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 \App\Jobs\Domain\VerifyJob($domain->id);
$job->handle();
$this->assertFalse($domain->fresh()->isVerified());
}
}

File Metadata

Mime Type
text/x-php
Expires
Thu, Nov 20, 5:22 PM (21 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
386851
Default Alt Text
VerifyTest.php (1 KB)

Event Timeline