mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
added it_get_all_plans_for_index_page test
This commit is contained in:
@@ -41,7 +41,8 @@ class PricingController extends Controller
|
||||
$collection = new PricingCollection($pricing);
|
||||
|
||||
// Sort and return pricing
|
||||
return $collection->sortBy('product.metadata.capacity')
|
||||
return $collection
|
||||
->sortBy('product.metadata.capacity')
|
||||
->values()
|
||||
->all();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class PricingResource extends JsonResource
|
||||
{
|
||||
$stripe = resolve('App\Services\StripeService');
|
||||
|
||||
$rates_puplic = [];
|
||||
$rates_public = [];
|
||||
|
||||
// Get tax rates
|
||||
$rates = $stripe->getTaxRates();
|
||||
@@ -54,7 +54,7 @@ class PricingResource extends JsonResource
|
||||
// Calculate tax
|
||||
$tax = $this['plan']['amount'] * ($rate['percentage'] / 100);
|
||||
|
||||
array_push($rates_puplic, [
|
||||
array_push($rates_public, [
|
||||
'id' => $rate['id'],
|
||||
'active' => $rate['active'],
|
||||
'jurisdiction' => $rate['jurisdiction'],
|
||||
@@ -63,6 +63,6 @@ class PricingResource extends JsonResource
|
||||
]);
|
||||
}
|
||||
|
||||
return $rates_puplic;
|
||||
return $rates_public;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ Route::post('/contact', [AppFunctionsController::class, 'contact_form']);
|
||||
Route::get('/page/{page}', [AppFunctionsController::class, 'get_page']);
|
||||
Route::get('/pricing', [PricingController::class, 'index']);
|
||||
|
||||
// Password
|
||||
// Password reset
|
||||
Route::group(['prefix' => 'password'], function () {
|
||||
Route::post('/email', [ForgotPasswordController::class, 'sendResetLinkEmail']);
|
||||
Route::post('/reset', [ResetPasswordController::class, 'reset']);
|
||||
|
||||
11
tests/Feature/External/SubscriptionTest.php
vendored
11
tests/Feature/External/SubscriptionTest.php
vendored
@@ -472,6 +472,17 @@ class SubscriptionTest extends TestCase
|
||||
->assertStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_get_all_plans_for_index_page()
|
||||
{
|
||||
$response = $this->getJson('/api/pricing')
|
||||
->assertStatus(200);
|
||||
|
||||
dd(json_decode($response->content(), true));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user