mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 16:22:14 +00:00
test groups refactoring
This commit is contained in:
56
tests/Domain/Subscriptions/AdminSubscriptionTest.php
Normal file
56
tests/Domain/Subscriptions/AdminSubscriptionTest.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Tests\Domain\Subscriptions;
|
||||
|
||||
|
||||
use Domain\Settings\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminSubscriptionTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function it_get_user_subscription_from_admin()
|
||||
{
|
||||
$user = User::factory(User::class)
|
||||
->create($this->user);
|
||||
|
||||
$this
|
||||
->actingAs($user)
|
||||
->postJson('/api/user/subscription/upgrade', [
|
||||
'billing' => $this->billing,
|
||||
'plan' => $this->plan,
|
||||
'payment' => [
|
||||
'type' => 'stripe',
|
||||
],
|
||||
])->assertStatus(204);
|
||||
|
||||
$admin = User::factory(User::class)
|
||||
->create(['role' => 'admin']);
|
||||
|
||||
$this
|
||||
->actingAs($admin)
|
||||
->getJson("/api/admin/users/$user->id/subscription")
|
||||
->assertStatus(200)
|
||||
->assertExactJson([
|
||||
"data" => [
|
||||
"id" => "business-pack",
|
||||
"type" => "subscription",
|
||||
"attributes" => [
|
||||
"incomplete" => false,
|
||||
"active" => true,
|
||||
"canceled" => false,
|
||||
"name" => "Business Packs",
|
||||
"capacity" => 1000,
|
||||
"capacity_formatted" => "1TB",
|
||||
"slug" => "business-pack",
|
||||
"canceled_at" => format_date(now(), '%d. %B. %Y'),
|
||||
"created_at" => format_date(now(), '%d. %B. %Y'),
|
||||
"ends_at" => format_date(now()->addMonth(), '%d. %B. %Y'),
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user