Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/DomainTest.php
Show First 20 Lines • Show All 342 Lines • ▼ Show 20 Lines | public function testRestore(): void | ||||
Queue::assertPushed(\App\Jobs\Domain\CreateJob::class, 1); | Queue::assertPushed(\App\Jobs\Domain\CreateJob::class, 1); | ||||
Queue::assertPushed( | Queue::assertPushed( | ||||
\App\Jobs\Domain\CreateJob::class, | \App\Jobs\Domain\CreateJob::class, | ||||
function ($job) use ($domain) { | function ($job) use ($domain) { | ||||
return $domain->id === TestCase::getObjectProperty($job, 'domainId'); | return $domain->id === TestCase::getObjectProperty($job, 'domainId'); | ||||
} | } | ||||
); | ); | ||||
} | } | ||||
/** | |||||
* Tests for Domain::walletOwner() (from EntitleableTrait) | |||||
*/ | |||||
public function testWalletOwner(): void | |||||
{ | |||||
$domain = $this->getTestDomain('kolab.org'); | |||||
$john = $this->getTestUser('john@kolab.org'); | |||||
$this->assertSame($john->id, $domain->walletOwner()->id); | |||||
// A domain without an owner | |||||
$domain = $this->getTestDomain('gmail.com', [ | |||||
'status' => Domain::STATUS_NEW | Domain::STATUS_SUSPENDED | |||||
| Domain::STATUS_LDAP_READY | Domain::STATUS_CONFIRMED, | |||||
'type' => Domain::TYPE_PUBLIC, | |||||
]); | |||||
$this->assertSame(null, $domain->walletOwner()); | |||||
} | |||||
} | } |