скрытие магазина
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Models\GameAccountUser;
|
||||
use App\Services\AzerothCoreAccountService;
|
||||
use App\Services\BalanceService;
|
||||
use App\Services\GameClientDownloadService;
|
||||
use App\Services\StoreAvailabilityService;
|
||||
use Illuminate\Support\Collection;
|
||||
use Inertia\Testing\AssertableInertia as Assert;
|
||||
use Mockery\MockInterface;
|
||||
@@ -13,6 +14,15 @@ use Tests\TestCase;
|
||||
|
||||
class CabinetFeatureTest extends TestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->mock(StoreAvailabilityService::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('isEnabled')->andReturn(true);
|
||||
});
|
||||
}
|
||||
|
||||
public function test_guest_is_redirected_to_login_for_cabinet(): void
|
||||
{
|
||||
$response = $this->get(route('cabinet.index'));
|
||||
@@ -53,6 +63,7 @@ class CabinetFeatureTest extends TestCase
|
||||
->component('Cabinet/Index', false)
|
||||
->where('account.username', 'PLAYERONE')
|
||||
->where('wallet.formatted_amount', '1 250,00')
|
||||
->where('wallet.deposit_enabled', true)
|
||||
->where('characters.0.name', 'Arthion')
|
||||
->has('characters', 1)
|
||||
->where('urls.client', route('cabinet.client'))
|
||||
@@ -60,6 +71,21 @@ class CabinetFeatureTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function test_payment_creation_is_blocked_when_store_is_disabled(): void
|
||||
{
|
||||
$this->mock(StoreAvailabilityService::class, function (MockInterface $mock): void {
|
||||
$mock->shouldReceive('isEnabled')->once()->andReturn(false);
|
||||
});
|
||||
$this->mock(\App\Services\RobokassaService::class, function (MockInterface $mock): void {
|
||||
$mock->shouldNotReceive('createInvoice');
|
||||
});
|
||||
|
||||
$this->actingAs($this->makeUser())
|
||||
->post(route('cabinet.balance.deposit'), ['amount' => 500])
|
||||
->assertRedirect(route('cabinet.index'))
|
||||
->assertSessionHas('error', 'Пополнение временно недоступно.');
|
||||
}
|
||||
|
||||
public function test_authenticated_user_can_change_password(): void
|
||||
{
|
||||
$user = $this->makeUser();
|
||||
|
||||
Reference in New Issue
Block a user