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; | ||||
machniak: This is not needed here. | |||||
/** | /** | ||||
* @group slow | * @group slow | ||||
* @group data | * @group data | ||||
* @group greylist | * @group greylist | ||||
*/ | */ | ||||
class GreylistTest extends TestCase | class GreylistTest extends TestCase | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 437 Lines • ▼ Show 20 Lines | public function testUserDisabled() | ||||
[ | [ | ||||
'sender' => 'someone@sender.domain', | 'sender' => 'someone@sender.domain', | ||||
'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 | |||||
$aliases = $this->domainOwner->aliases()->orderBy('alias')->get(); | |||||
$request = new Greylist\Request( | |||||
[ | |||||
'sender' => 'someone@sender.domain', | |||||
'recipient' => $aliases[0]->alias, | |||||
'client_address' => $this->clientAddress | |||||
] | |||||
); | |||||
$this->assertFalse($request->shouldDefer()); | |||||
} | } | ||||
public function testUserEnabled() | public function testUserEnabled() | ||||
{ | { | ||||
$connect = Greylist\Connect::create( | $connect = Greylist\Connect::create( | ||||
[ | [ | ||||
'sender_local' => 'someone', | 'sender_local' => 'someone', | ||||
'sender_domain' => 'sender.domain', | 'sender_domain' => 'sender.domain', | ||||
▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines |
This is not needed here.