Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117382638
D1156.1774822171.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D1156.1774822171.diff
View Options
diff --git a/src/app/Jobs/DomainCreate.php b/src/app/Jobs/DomainCreate.php
--- a/src/app/Jobs/DomainCreate.php
+++ b/src/app/Jobs/DomainCreate.php
@@ -48,6 +48,8 @@
$this->domain->status |= Domain::STATUS_LDAP_READY;
$this->domain->save();
+
+ DomainVerify::dispatch($this->domain);
}
}
}
diff --git a/src/app/Observers/DomainObserver.php b/src/app/Observers/DomainObserver.php
--- a/src/app/Observers/DomainObserver.php
+++ b/src/app/Observers/DomainObserver.php
@@ -36,7 +36,8 @@
*/
public function created(Domain $domain)
{
- // Create domain record in LDAP, then check if it exists in DNS
+ // Create domain record in LDAP
+ // Note: DomainCreate job will dispatch DomainVerify job
\App\Jobs\DomainCreate::dispatch($domain);
}
diff --git a/src/tests/Feature/Jobs/DomainCreateTest.php b/src/tests/Feature/Jobs/DomainCreateTest.php
--- a/src/tests/Feature/Jobs/DomainCreateTest.php
+++ b/src/tests/Feature/Jobs/DomainCreateTest.php
@@ -44,9 +44,25 @@
$this->assertFalse($domain->isLdapReady());
+ // Fake the queue, assert that no jobs were pushed...
+ Queue::fake();
+ Queue::assertNothingPushed();
+
$job = new DomainCreate($domain);
$job->handle();
$this->assertTrue($domain->fresh()->isLdapReady());
+
+ Queue::assertPushed(\App\Jobs\DomainVerify::class, 1);
+
+ Queue::assertPushed(
+ \App\Jobs\DomainVerify::class,
+ function ($job) use ($domain) {
+ $job_domain = TestCase::getObjectProperty($job, 'domain');
+
+ return $job_domain->id === $domain->id &&
+ $job_domain->namespace === $domain->namespace;
+ }
+ );
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 29, 10:09 PM (4 d, 22 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18716904
Default Alt Text
D1156.1774822171.diff (1 KB)
Attached To
Mode
D1156: Dispatch DomainVerify job after domain creation in LDAP
Attached
Detach File
Event Timeline