Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Stories/GreylistTest.php
<?php | <?php | ||||
namespace Tests\Feature\Stories; | namespace Tests\Feature\Stories; | ||||
use App\Policy\Greylist; | use App\Policy\Greylist; | ||||
use Illuminate\Support\Facades\DB; | use Illuminate\Support\Facades\DB; | ||||
use Tests\TestCase; | use Tests\TestCase; | ||||
/** | /** | ||||
* @group slow | * @group slow | ||||
* @group data | * @group data | ||||
* @group greylist | * @group greylist | ||||
*/ | */ | ||||
class GreylistTest extends TestCase | class GreylistTest extends TestCase | ||||
{ | { | ||||
private $clientAddress; | private $clientAddress; | ||||
private $requests = []; | |||||
private $net; | private $net; | ||||
public function setUp(): void | public function setUp(): void | ||||
{ | { | ||||
parent::setUp(); | parent::setUp(); | ||||
$this->setUpTest(); | $this->setUpTest(); | ||||
$this->useServicesUrl(); | $this->useServicesUrl(); | ||||
▲ Show 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | public function testUserDisabled() | ||||
'recipient' => $this->domainOwner->email, | 'recipient' => $this->domainOwner->email, | ||||
'client_address' => $this->clientAddress | 'client_address' => $this->clientAddress | ||||
] | ] | ||||
); | ); | ||||
$this->assertFalse($request->shouldDefer()); | $this->assertFalse($request->shouldDefer()); | ||||
// Ensure we also find the setting by alias | // Ensure we also find the setting by alias | ||||
$aliases = $this->domainOwner->aliases()->orderBy('alias')->get(); | $aliases = $this->domainOwner->aliases()->orderBy('alias')->pluck('alias')->all(); | ||||
$request = new Greylist\Request( | $request = new Greylist\Request( | ||||
[ | [ | ||||
'sender' => 'someone@sender.domain', | 'sender' => 'someone@sender.domain', | ||||
'recipient' => $aliases[0]->alias, | 'recipient' => $aliases[0], | ||||
'client_address' => $this->clientAddress | 'client_address' => $this->clientAddress | ||||
] | ] | ||||
); | ); | ||||
$this->assertFalse($request->shouldDefer()); | $this->assertFalse($request->shouldDefer()); | ||||
} | } | ||||
public function testUserEnabled() | public function testUserEnabled() | ||||
▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines |