Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/DomainsTest.php
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | public function testConfirm(): void | ||||
$ned = $this->getTestUser('ned@kolab.org'); | $ned = $this->getTestUser('ned@kolab.org'); | ||||
$user = $this->getTestUser('test1@domainscontroller.com'); | $user = $this->getTestUser('test1@domainscontroller.com'); | ||||
$domain = $this->getTestDomain('domainscontroller.com', [ | $domain = $this->getTestDomain('domainscontroller.com', [ | ||||
'status' => Domain::STATUS_NEW, | 'status' => Domain::STATUS_NEW, | ||||
'type' => Domain::TYPE_EXTERNAL, | 'type' => Domain::TYPE_EXTERNAL, | ||||
]); | ]); | ||||
Entitlement::create([ | Entitlement::create([ | ||||
'owner_id' => $user->id, | |||||
'wallet_id' => $user->wallets()->first()->id, | 'wallet_id' => $user->wallets()->first()->id, | ||||
'sku_id' => $sku_domain->id, | 'sku_id' => $sku_domain->id, | ||||
'entitleable_id' => $domain->id, | 'entitleable_id' => $domain->id, | ||||
'entitleable_type' => Domain::class | 'entitleable_type' => Domain::class | ||||
]); | ]); | ||||
$response = $this->actingAs($user)->get("api/v4/domains/{$domain->id}/confirm"); | $response = $this->actingAs($user)->get("api/v4/domains/{$domain->id}/confirm"); | ||||
$response->assertStatus(200); | $response->assertStatus(200); | ||||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | public function testShow(): void | ||||
$sku_domain = Sku::where('title', 'domain-hosting')->first(); | $sku_domain = Sku::where('title', 'domain-hosting')->first(); | ||||
$user = $this->getTestUser('test1@domainscontroller.com'); | $user = $this->getTestUser('test1@domainscontroller.com'); | ||||
$domain = $this->getTestDomain('domainscontroller.com', [ | $domain = $this->getTestDomain('domainscontroller.com', [ | ||||
'status' => Domain::STATUS_NEW, | 'status' => Domain::STATUS_NEW, | ||||
'type' => Domain::TYPE_EXTERNAL, | 'type' => Domain::TYPE_EXTERNAL, | ||||
]); | ]); | ||||
Entitlement::create([ | Entitlement::create([ | ||||
'owner_id' => $user->id, | |||||
'wallet_id' => $user->wallets()->first()->id, | 'wallet_id' => $user->wallets()->first()->id, | ||||
'sku_id' => $sku_domain->id, | 'sku_id' => $sku_domain->id, | ||||
'entitleable_id' => $domain->id, | 'entitleable_id' => $domain->id, | ||||
'entitleable_type' => Domain::class | 'entitleable_type' => Domain::class | ||||
]); | ]); | ||||
$response = $this->actingAs($user)->get("api/v4/domains/{$domain->id}"); | $response = $this->actingAs($user)->get("api/v4/domains/{$domain->id}"); | ||||
$response->assertStatus(200); | $response->assertStatus(200); | ||||
Show All 36 Lines |