Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F19023560
D2827.1742007584.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D2827.1742007584.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
Sat, Mar 15, 3:59 AM (9 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
11312316
Default Alt Text
D2827.1742007584.diff (3 KB)
Attached To
Mode
D2827: GreylistTest enhancements
Attached
Detach File
Event Timeline
Log In to Comment