1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-16 08:02:40 +01:00
invoiceninja/tests/Feature/ClientModelTest.php

57 lines
1.2 KiB
PHP
Raw Normal View History

2019-09-18 14:43:37 +02:00
<?php
2020-09-14 13:11:46 +02:00
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
2020-09-14 13:11:46 +02:00
*
* @license https://opensource.org/licenses/AAL
*/
2021-07-02 08:36:14 +02:00
2019-09-18 14:43:37 +02:00
namespace Tests\Feature;
2021-07-02 08:36:14 +02:00
use App\Models\CompanyGateway;
2019-09-18 14:43:37 +02:00
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\URL;
use Tests\MockAccountData;
use Tests\TestCase;
/**
* @test
* @covers App\Models\Client
*/
class ClientModelTest extends TestCase
{
use MockAccountData;
2019-09-18 14:43:37 +02:00
use DatabaseTransactions;
public function setUp() :void
{
parent::setUp();
$this->makeTestData();
2019-09-18 14:43:37 +02:00
if (config('ninja.testvars.travis') !== false) {
2019-10-07 08:43:19 +02:00
$this->markTestSkipped('Skip test for Travis');
}
if (! config('ninja.testvars.stripe')) {
$this->markTestSkipped('Skip test no company gateways installed');
}
}
2019-09-18 14:43:37 +02:00
public function testPaymentMethodsWithCreditsEnforced()
{
$amount = 40;
2019-09-18 14:43:37 +02:00
$payment_methods = $this->client->service()->getPaymentMethods(40);
2019-09-18 14:43:37 +02:00
2021-07-02 08:36:14 +02:00
$this->assertGreaterThan(0, CompanyGateway::count());
$this->assertEquals(1, count($payment_methods));
}
2019-09-18 14:43:37 +02:00
}