mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Disable all kinds of tests until upgrades are complete.
This commit is contained in:
@@ -24,12 +24,12 @@ declare(strict_types=1);
|
||||
namespace Tests\Unit\Factory;
|
||||
|
||||
|
||||
use Amount;
|
||||
use FireflyIII\Factory\BillFactory;
|
||||
use FireflyIII\Factory\TransactionCurrencyFactory;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use Log;
|
||||
use Tests\TestCase;
|
||||
use Amount;
|
||||
|
||||
/**
|
||||
* Class BillFactoryTest
|
||||
@@ -128,47 +128,6 @@ class BillFactoryTest extends TestCase
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Create basic bill with minimum data.
|
||||
*
|
||||
* @covers \FireflyIII\Factory\BillFactory
|
||||
* @covers \FireflyIII\Services\Internal\Support\BillServiceTrait
|
||||
*/
|
||||
public function testCreateNoCurrency(): void
|
||||
{
|
||||
$currencyFactory = $this->mock(TransactionCurrencyFactory::class);
|
||||
$data = [
|
||||
'name' => 'Some new bill #' . random_int(1, 10000),
|
||||
'amount_min' => '5',
|
||||
'amount_max' => '10',
|
||||
'date' => '2018-01-01',
|
||||
'repeat_freq' => 'monthly',
|
||||
'skip' => 0,
|
||||
'automatch' => true,
|
||||
'active' => true,
|
||||
'notes' => 'Hello!',
|
||||
];
|
||||
|
||||
$currencyFactory->shouldReceive('find')->atLeast()->once()
|
||||
->withArgs([0, ''])->andReturnNull();
|
||||
|
||||
Amount::shouldReceive('getDefaultCurrencyByUser')->atLeast()->once()->andReturn(TransactionCurrency::find(3));
|
||||
|
||||
|
||||
/** @var BillFactory $factory */
|
||||
$factory = app(BillFactory::class);
|
||||
$factory->setUser($this->user());
|
||||
$bill = $factory->create($data);
|
||||
|
||||
$this->assertEquals($data['name'], $bill->name);
|
||||
$this->assertEquals($data['amount_min'], $bill->amount_min);
|
||||
$this->assertEquals(3, $bill->transaction_currency_id);
|
||||
$this->assertEquals($data['repeat_freq'], $bill->repeat_freq);
|
||||
$note = $bill->notes()->first();
|
||||
$this->assertEquals($data['notes'], $note->text);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Create basic bill with minimum data.
|
||||
*
|
||||
@@ -209,6 +168,47 @@ class BillFactoryTest extends TestCase
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Create basic bill with minimum data.
|
||||
*
|
||||
* @covers \FireflyIII\Factory\BillFactory
|
||||
* @covers \FireflyIII\Services\Internal\Support\BillServiceTrait
|
||||
*/
|
||||
public function testCreateNoCurrency(): void
|
||||
{
|
||||
$currencyFactory = $this->mock(TransactionCurrencyFactory::class);
|
||||
$data = [
|
||||
'name' => 'Some new bill #' . random_int(1, 10000),
|
||||
'amount_min' => '5',
|
||||
'amount_max' => '10',
|
||||
'date' => '2018-01-01',
|
||||
'repeat_freq' => 'monthly',
|
||||
'skip' => 0,
|
||||
'automatch' => true,
|
||||
'active' => true,
|
||||
'notes' => 'Hello!',
|
||||
];
|
||||
|
||||
$currencyFactory->shouldReceive('find')->atLeast()->once()
|
||||
->withArgs([0, ''])->andReturnNull();
|
||||
|
||||
Amount::shouldReceive('getDefaultCurrencyByUser')->atLeast()->once()->andReturn(TransactionCurrency::find(3));
|
||||
|
||||
|
||||
/** @var BillFactory $factory */
|
||||
$factory = app(BillFactory::class);
|
||||
$factory->setUser($this->user());
|
||||
$bill = $factory->create($data);
|
||||
|
||||
$this->assertEquals($data['name'], $bill->name);
|
||||
$this->assertEquals($data['amount_min'], $bill->amount_min);
|
||||
$this->assertEquals(3, $bill->transaction_currency_id);
|
||||
$this->assertEquals($data['repeat_freq'], $bill->repeat_freq);
|
||||
$note = $bill->notes()->first();
|
||||
$this->assertEquals($data['notes'], $note->text);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Find by ID
|
||||
*
|
||||
|
Reference in New Issue
Block a user