Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117750502
D2827.1775183152.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
D2827.1775183152.diff
View Options
diff --git a/src/tests/Feature/Stories/GreylistTest.php b/src/tests/Feature/Stories/GreylistTest.php
--- a/src/tests/Feature/Stories/GreylistTest.php
+++ b/src/tests/Feature/Stories/GreylistTest.php
@@ -171,20 +171,6 @@
// public function testWhitelistUpdate() {}
- public function testNew()
- {
- $data = [
- 'sender' => 'someone@sender.domain',
- 'recipient' => $this->domainOwner->email,
- 'client_address' => $this->clientAddress,
- 'client_name' => 'some.mx'
- ];
-
- $response = $this->post('/api/webhooks/policy/greylist', $data);
-
- $response->assertStatus(403);
- }
-
public function testRetry()
{
$connect = Greylist\Connect::create(
@@ -214,7 +200,7 @@
$this->assertFalse($request->shouldDefer());
}
- public function testInvalidDomain()
+ public function testInvalidRecipient()
{
$connect = Greylist\Connect::create(
[
@@ -240,32 +226,6 @@
$this->assertTrue($request->shouldDefer());
}
- public function testInvalidUser()
- {
- $connect = Greylist\Connect::create(
- [
- 'sender_local' => 'someone',
- 'sender_domain' => 'sender.domain',
- 'recipient_hash' => hash('sha256', $this->domainOwner->email),
- 'recipient_id' => 1234,
- 'recipient_type' => \App\User::class,
- 'connect_count' => 1,
- 'net_id' => $this->net->id,
- 'net_type' => \App\IP4Net::class
- ]
- );
-
- $request = new Greylist\Request(
- [
- 'sender' => 'someone@sender.domain',
- 'recipient' => 'not.someone@that.exists',
- 'client_address' => $this->clientAddress
- ]
- );
-
- $this->assertTrue($request->shouldDefer());
- }
-
public function testUserDisabled()
{
$connect = Greylist\Connect::create(
@@ -426,4 +386,49 @@
}
}
}
+
+ public function testControllerNew()
+ {
+ $data = [
+ 'sender' => 'someone@sender.domain',
+ 'recipient' => $this->domainOwner->email,
+ 'client_address' => $this->clientAddress,
+ 'client_name' => 'some.mx'
+ ];
+
+ $response = $this->post('/api/webhooks/policy/greylist', $data);
+
+ $response->assertStatus(403);
+ }
+
+ public function testControllerNotNew()
+ {
+ $connect = Greylist\Connect::create(
+ [
+ 'sender_local' => 'someone',
+ 'sender_domain' => 'sender.domain',
+ 'recipient_hash' => hash('sha256', $this->domainOwner->email),
+ 'recipient_id' => $this->domainOwner->id,
+ 'recipient_type' => \App\User::class,
+ 'connect_count' => 1,
+ 'net_id' => $this->net->id,
+ 'net_type' => \App\IP4Net::class
+ ]
+ );
+
+ $connect->created_at = \Carbon\Carbon::now()->subMinutes(6);
+ $connect->save();
+
+ $data = [
+ 'sender' => 'someone@sender.domain',
+ 'recipient' => $this->domainOwner->email,
+ 'client_address' => $this->clientAddress,
+ 'client_name' => 'some.mx'
+ ];
+
+ $response = $this->post('/api/webhooks/policy/greylist', $data);
+
+ $response->assertStatus(200);
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 3, 2:25 AM (8 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18822135
Default Alt Text
D2827.1775183152.diff (3 KB)
Attached To
Mode
D2827: GreylistTest enhancements
Attached
Detach File
Event Timeline