mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 03:24:35 -04:00
Fixes for tests
This commit is contained in:
parent
67a444ad2b
commit
8eb8f6e098
@ -22,10 +22,9 @@ class Subscription extends BaseModel
|
|||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'user_id',
|
'user_id',
|
||||||
'product_id',
|
'product_ids',
|
||||||
|
'recurring_product_ids',
|
||||||
'company_id',
|
'company_id',
|
||||||
'product_id',
|
|
||||||
'is_recurring',
|
|
||||||
'frequency_id',
|
'frequency_id',
|
||||||
'auto_bill',
|
'auto_bill',
|
||||||
'promo_code',
|
'promo_code',
|
||||||
@ -43,6 +42,7 @@ class Subscription extends BaseModel
|
|||||||
'refund_period',
|
'refund_period',
|
||||||
'webhook_configuration',
|
'webhook_configuration',
|
||||||
'currency_id',
|
'currency_id',
|
||||||
|
'group_id',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
|
@ -21,10 +21,12 @@ class RefactorBillingScriptionsTable extends Migration
|
|||||||
$table->text('recurring_product_ids');
|
$table->text('recurring_product_ids');
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->unique(['company_id', 'name']);
|
$table->unique(['company_id', 'name']);
|
||||||
|
$table->unsignedInteger('group_id');
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::table('subscriptions', function (Blueprint $table) {
|
Schema::table('subscriptions', function (Blueprint $table) {
|
||||||
$table->renameColumn('product_id', 'product_ids');
|
$table->renameColumn('product_id', 'product_ids');
|
||||||
|
$table->dropColumn('is_recurring');
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ class SubscriptionApiTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$billing_subscription = Subscription::factory()->create([
|
$billing_subscription = Subscription::factory()->create([
|
||||||
'product_id' => $product->id,
|
'product_ids' => $product->id,
|
||||||
'company_id' => $this->company->id,
|
'company_id' => $this->company->id,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ class SubscriptionApiTest extends TestCase
|
|||||||
$response = $this->withHeaders([
|
$response = $this->withHeaders([
|
||||||
'X-API-SECRET' => config('ninja.api_secret'),
|
'X-API-SECRET' => config('ninja.api_secret'),
|
||||||
'X-API-TOKEN' => $this->token,
|
'X-API-TOKEN' => $this->token,
|
||||||
])->post('/api/v1/subscriptions', ['product_id' => $product->id, 'allow_cancellation' => true]);
|
])->post('/api/v1/subscriptions', ['product_ids' => $product->id, 'allow_cancellation' => true]);
|
||||||
|
|
||||||
$response->assertStatus(200);
|
$response->assertStatus(200);
|
||||||
}
|
}
|
||||||
@ -92,7 +92,7 @@ class SubscriptionApiTest extends TestCase
|
|||||||
|
|
||||||
$response1 = $this
|
$response1 = $this
|
||||||
->withHeaders(['X-API-SECRET' => config('ninja.api_secret'),'X-API-TOKEN' => $this->token])
|
->withHeaders(['X-API-SECRET' => config('ninja.api_secret'),'X-API-TOKEN' => $this->token])
|
||||||
->post('/api/v1/subscriptions', ['product_id' => $product->id])
|
->post('/api/v1/subscriptions', ['product_ids' => $product->id])
|
||||||
->assertStatus(200)
|
->assertStatus(200)
|
||||||
->json();
|
->json();
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ class SubscriptionApiTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$billing_subscription = Subscription::factory()->create([
|
$billing_subscription = Subscription::factory()->create([
|
||||||
'product_id' => $product->id,
|
'product_ids' => $product->id,
|
||||||
'company_id' => $this->company->id,
|
'company_id' => $this->company->id,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user