Update test code.

This commit is contained in:
James Cole
2018-05-11 19:58:10 +02:00
parent 9bb4df4cc3
commit 4d6bc55723
174 changed files with 2138 additions and 940 deletions

View File

@@ -32,7 +32,7 @@ class ExampleTest extends TestCase
/**
* A basic test example.
*/
public function testBasicTest()
public function testBasicTest(): void
{
$this->assertTrue(true);
}

View File

@@ -42,7 +42,7 @@ class AccountFactoryTest extends TestCase
* @covers \FireflyIII\Factory\AccountMetaFactory
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testCreateBasic()
public function testCreateBasic(): void
{
$data = [
@@ -81,7 +81,7 @@ class AccountFactoryTest extends TestCase
* @covers \FireflyIII\Factory\AccountMetaFactory
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testCreateBasicEmptyVb()
public function testCreateBasicEmptyVb(): void
{
$data = [
@@ -120,7 +120,7 @@ class AccountFactoryTest extends TestCase
* @covers \FireflyIII\Factory\AccountMetaFactory
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testCreateBasicCC()
public function testCreateBasicCC(): void
{
$data = [
@@ -167,7 +167,7 @@ class AccountFactoryTest extends TestCase
* @covers \FireflyIII\Factory\AccountMetaFactory
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testCreateBasicExpense()
public function testCreateBasicExpense(): void
{
$data = [
@@ -206,7 +206,7 @@ class AccountFactoryTest extends TestCase
* @covers \FireflyIII\Factory\AccountMetaFactory
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testCreateBasicExpenseFullType()
public function testCreateBasicExpenseFullType(): void
{
$data = [
@@ -244,7 +244,7 @@ class AccountFactoryTest extends TestCase
* @covers \FireflyIII\Factory\AccountMetaFactory
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testCreateBasicIB()
public function testCreateBasicIB(): void
{
$data = [
@@ -290,7 +290,7 @@ class AccountFactoryTest extends TestCase
* @covers \FireflyIII\Factory\AccountMetaFactory
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testCreateBasicIBZero()
public function testCreateBasicIBZero(): void
{
$data = [
@@ -335,7 +335,7 @@ class AccountFactoryTest extends TestCase
* @covers \FireflyIII\Factory\AccountMetaFactory
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testCreateBasicIban()
public function testCreateBasicIban(): void
{
$data = [
@@ -374,7 +374,7 @@ class AccountFactoryTest extends TestCase
* @covers \FireflyIII\Factory\AccountMetaFactory
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testCreateBasicInvalidIban()
public function testCreateBasicInvalidIban(): void
{
$data = [
@@ -413,7 +413,7 @@ class AccountFactoryTest extends TestCase
* @covers \FireflyIII\Factory\AccountMetaFactory
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testCreateBasicNegativeIB()
public function testCreateBasicNegativeIB(): void
{
$data = [
@@ -459,7 +459,7 @@ class AccountFactoryTest extends TestCase
* @covers \FireflyIII\Factory\AccountMetaFactory
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testCreateBasicNotes()
public function testCreateBasicNotes(): void
{
$data = [
@@ -500,7 +500,7 @@ class AccountFactoryTest extends TestCase
*
* @covers \FireflyIII\Factory\AccountFactory
*/
public function testCreateExisting()
public function testCreateExisting(): void
{
$existing = $this->user()->accounts()->where('account_type_id', 3)->first();
$data = [

View File

@@ -39,7 +39,7 @@ class BillFactoryTest extends TestCase
* @covers \FireflyIII\Factory\BillFactory
* @covers \FireflyIII\Services\Internal\Support\BillServiceTrait
*/
public function testCreateBasic()
public function testCreateBasic(): void
{
$data = [
'name' => 'Some new bill #' . random_int(1, 1000),
@@ -73,7 +73,7 @@ class BillFactoryTest extends TestCase
* @covers \FireflyIII\Factory\BillFactory
* @covers \FireflyIII\Services\Internal\Support\BillServiceTrait
*/
public function testCreateEmptyNotes()
public function testCreateEmptyNotes(): void
{
$data = [
'name' => 'Some new bill #' . random_int(1, 1000),
@@ -106,7 +106,7 @@ class BillFactoryTest extends TestCase
* @covers \FireflyIII\Factory\BillFactory
*
*/
public function testFindById()
public function testFindById(): void
{
$existing = $this->user()->piggyBanks()->first();
/** @var BillFactory $factory */
@@ -122,7 +122,7 @@ class BillFactoryTest extends TestCase
* @covers \FireflyIII\Factory\BillFactory
*
*/
public function testFindByName()
public function testFindByName(): void
{
$existing = $this->user()->bills()->first();
/** @var BillFactory $factory */
@@ -139,7 +139,7 @@ class BillFactoryTest extends TestCase
* @covers \FireflyIII\Factory\BillFactory
*
*/
public function testFindByUnknownName()
public function testFindByUnknownName(): void
{
/** @var BillFactory $factory */
$factory = app(BillFactory::class);
@@ -155,7 +155,7 @@ class BillFactoryTest extends TestCase
* @covers \FireflyIII\Factory\BillFactory
*
*/
public function testFindNull()
public function testFindNull(): void
{
/** @var BillFactory $factory */
$factory = app(BillFactory::class);

View File

@@ -37,7 +37,7 @@ class BudgetFactoryTest extends TestCase
*
* @covers \FireflyIII\Factory\BudgetFactory
*/
public function testFindById()
public function testFindById(): void
{
$existing = $this->user()->budgets()->first();
/** @var BudgetFactory $factory */
@@ -54,7 +54,7 @@ class BudgetFactoryTest extends TestCase
*
* @covers \FireflyIII\Factory\BudgetFactory
*/
public function testFindByName()
public function testFindByName(): void
{
$existing = $this->user()->budgets()->first();
/** @var BudgetFactory $factory */
@@ -71,7 +71,7 @@ class BudgetFactoryTest extends TestCase
*
* @covers \FireflyIII\Factory\BudgetFactory
*/
public function testFindNull()
public function testFindNull(): void
{
/** @var BudgetFactory $factory */
$factory = app(BudgetFactory::class);
@@ -86,7 +86,7 @@ class BudgetFactoryTest extends TestCase
*
* @covers \FireflyIII\Factory\BudgetFactory
*/
public function testFindUnknown()
public function testFindUnknown(): void
{
/** @var BudgetFactory $factory */
$factory = app(BudgetFactory::class);

View File

@@ -34,7 +34,7 @@ class CategoryFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\CategoryFactory
*/
public function testFindOrCreateExistingID()
public function testFindOrCreateExistingID(): void
{
$existing = $this->user()->categories()->first();
@@ -48,7 +48,7 @@ class CategoryFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\CategoryFactory
*/
public function testFindOrCreateExistingName()
public function testFindOrCreateExistingName(): void
{
$existing = $this->user()->categories()->first();
@@ -64,7 +64,7 @@ class CategoryFactoryTest extends TestCase
*
* @covers \FireflyIII\Factory\CategoryFactory
*/
public function testFindOrCreateInvalidID()
public function testFindOrCreateInvalidID(): void
{
$existing = $this->user()->categories()->max('id');
$existing += 4;
@@ -78,7 +78,7 @@ class CategoryFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\CategoryFactory
*/
public function testFindOrCreateNewName()
public function testFindOrCreateNewName(): void
{
$name = 'Some new category #' . random_int(1, 1000);
@@ -92,7 +92,7 @@ class CategoryFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\CategoryFactory
*/
public function testFindOrCreateNull()
public function testFindOrCreateNull(): void
{
/** @var CategoryFactory $factory */
$factory = app(CategoryFactory::class);

View File

@@ -39,7 +39,7 @@ class PiggyBankEventFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\PiggyBankEventFactory
*/
public function testCreateAmountZero()
public function testCreateAmountZero(): void
{
/** @var TransactionJournal $transfer */
$transfer = $this->user()->transactionJournals()->where('transaction_type_id', 3)->first();
@@ -60,7 +60,7 @@ class PiggyBankEventFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\PiggyBankEventFactory
*/
public function testCreateNoPiggy()
public function testCreateNoPiggy(): void
{
/** @var TransactionJournal $transfer */
$transfer = $this->user()->transactionJournals()->where('transaction_type_id', 3)->first();
@@ -96,7 +96,7 @@ class PiggyBankEventFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\PiggyBankEventFactory
*/
public function testCreateNotTransfer()
public function testCreateNotTransfer(): void
{
/** @var TransactionJournal $deposit */
$deposit = $this->user()->transactionJournals()->where('transaction_type_id', 2)->first();
@@ -110,7 +110,7 @@ class PiggyBankEventFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\PiggyBankEventFactory
*/
public function testCreateSuccess()
public function testCreateSuccess(): void
{
/** @var TransactionJournal $transfer */
$transfer = $this->user()->transactionJournals()->where('transaction_type_id', 3)->first();

View File

@@ -37,7 +37,7 @@ class PiggyBankFactoryTest extends TestCase
*
* @covers \FireflyIII\Factory\PiggyBankFactory
*/
public function testFindById()
public function testFindById(): void
{
$existing = $this->user()->piggyBanks()->first();
/** @var PiggyBankFactory $factory */
@@ -54,7 +54,7 @@ class PiggyBankFactoryTest extends TestCase
*
* @covers \FireflyIII\Factory\PiggyBankFactory
*/
public function testFindByName()
public function testFindByName(): void
{
$existing = $this->user()->piggyBanks()->first();
/** @var PiggyBankFactory $factory */
@@ -71,7 +71,7 @@ class PiggyBankFactoryTest extends TestCase
*
* @covers \FireflyIII\Factory\PiggyBankFactory
*/
public function testFindNull()
public function testFindNull(): void
{
/** @var PiggyBankFactory $factory */
$factory = app(PiggyBankFactory::class);
@@ -86,7 +86,7 @@ class PiggyBankFactoryTest extends TestCase
*
* @covers \FireflyIII\Factory\PiggyBankFactory
*/
public function testFindUnknown()
public function testFindUnknown(): void
{
/** @var PiggyBankFactory $factory */
$factory = app(PiggyBankFactory::class);

View File

@@ -35,7 +35,7 @@ class TagFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\TagFactory
*/
public function testFindOrCreateExisting()
public function testFindOrCreateExisting(): void
{
$tag = $this->user()->tags()->first();
/** @var TagFactory $factory */
@@ -49,7 +49,7 @@ class TagFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\TagFactory
*/
public function testFindOrCreateNew()
public function testFindOrCreateNew(): void
{
$tag = 'Some new tag#' . random_int(1, 1000);
/** @var TagFactory $factory */

View File

@@ -36,7 +36,7 @@ class TransactionCurrencyFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\TransactionCurrencyFactory
*/
public function testCreate()
public function testCreate(): void
{
/** @var TransactionCurrencyFactory $factory */
$factory = app(TransactionCurrencyFactory::class);
@@ -48,7 +48,7 @@ class TransactionCurrencyFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\TransactionCurrencyFactory
*/
public function testCreateEmpty()
public function testCreateEmpty(): void
{
/** @var TransactionCurrencyFactory $factory */
$factory = app(TransactionCurrencyFactory::class);
@@ -59,7 +59,7 @@ class TransactionCurrencyFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\TransactionCurrencyFactory
*/
public function testFindByBadCode()
public function testFindByBadCode(): void
{
/** @var TransactionCurrencyFactory $factory */
$factory = app(TransactionCurrencyFactory::class);
@@ -70,7 +70,7 @@ class TransactionCurrencyFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\TransactionCurrencyFactory
*/
public function testFindByCode()
public function testFindByCode(): void
{
// ;
$currency = TransactionCurrency::inRandomOrder()->whereNull('deleted_at')->first();
@@ -83,7 +83,7 @@ class TransactionCurrencyFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\TransactionCurrencyFactory
*/
public function testFindByID()
public function testFindByID(): void
{
$currency = TransactionCurrency::inRandomOrder()->whereNull('deleted_at')->first();
/** @var TransactionCurrencyFactory $factory */
@@ -95,7 +95,7 @@ class TransactionCurrencyFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\TransactionCurrencyFactory
*/
public function testFindNull()
public function testFindNull(): void
{
/** @var TransactionCurrencyFactory $factory */
$factory = app(TransactionCurrencyFactory::class);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace Tests\Unit\Factory;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Factory\AccountFactory;
use FireflyIII\Factory\BudgetFactory;
use FireflyIII\Factory\CategoryFactory;
@@ -45,7 +46,7 @@ class TransactionFactoryTest extends TestCase
* @covers \FireflyIII\Factory\TransactionFactory
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
*/
public function testCreatePairBasic()
public function testCreatePairBasic(): void
{
// objects:
$asset = $this->user()->accounts()->where('account_type_id', 3)->first();
@@ -97,7 +98,11 @@ class TransactionFactoryTest extends TestCase
/** @var TransactionFactory $factory */
$factory = app(TransactionFactory::class);
$factory->setUser($this->user());
$collection = $factory->createPair($withdrawal, $data);
try {
$collection = $factory->createPair($withdrawal, $data);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$newCount = $withdrawal->transactions()->count();
@@ -119,7 +124,7 @@ class TransactionFactoryTest extends TestCase
* @covers \FireflyIII\Factory\TransactionFactory
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
*/
public function testCreatePairBasicByName()
public function testCreatePairBasicByName(): void
{
// objects:
$asset = $this->user()->accounts()->where('account_type_id', 3)->first();
@@ -175,7 +180,11 @@ class TransactionFactoryTest extends TestCase
/** @var TransactionFactory $factory */
$factory = app(TransactionFactory::class);
$factory->setUser($this->user());
$collection = $factory->createPair($withdrawal, $data);
try {
$collection = $factory->createPair($withdrawal, $data);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$newCount = $withdrawal->transactions()->count();
@@ -197,7 +206,7 @@ class TransactionFactoryTest extends TestCase
* @covers \FireflyIII\Factory\TransactionFactory
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
*/
public function testCreatePairBasicIntoCash()
public function testCreatePairBasicIntoCash(): void
{
// objects:
$asset = $this->user()->accounts()->where('account_type_id', 3)->first();
@@ -253,8 +262,11 @@ class TransactionFactoryTest extends TestCase
/** @var TransactionFactory $factory */
$factory = app(TransactionFactory::class);
$factory->setUser($this->user());
$collection = $factory->createPair($withdrawal, $data);
try {
$collection = $factory->createPair($withdrawal, $data);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$newCount = $withdrawal->transactions()->count();
$this->assertCount(2, $collection);
@@ -277,7 +289,7 @@ class TransactionFactoryTest extends TestCase
* @covers \FireflyIII\Factory\TransactionFactory
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
*/
public function testCreatePairBasicMeta()
public function testCreatePairBasicMeta(): void
{
// objects:
$asset = $this->user()->accounts()->where('account_type_id', 3)->first();
@@ -331,8 +343,11 @@ class TransactionFactoryTest extends TestCase
/** @var TransactionFactory $factory */
$factory = app(TransactionFactory::class);
$factory->setUser($this->user());
$collection = $factory->createPair($withdrawal, $data);
try {
$collection = $factory->createPair($withdrawal, $data);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$newCount = $withdrawal->transactions()->count();
$this->assertCount(2, $collection);
@@ -357,7 +372,7 @@ class TransactionFactoryTest extends TestCase
* @covers \FireflyIII\Factory\TransactionFactory
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
*/
public function testCreatePairDeposit()
public function testCreatePairDeposit(): void
{
// objects:
$asset = $this->user()->accounts()->where('account_type_id', 3)->first();
@@ -410,8 +425,11 @@ class TransactionFactoryTest extends TestCase
/** @var TransactionFactory $factory */
$factory = app(TransactionFactory::class);
$factory->setUser($this->user());
$collection = $factory->createPair($deposit, $data);
try {
$collection = $factory->createPair($deposit, $data);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$newCount = $deposit->transactions()->count();
$this->assertCount(2, $collection);
@@ -434,7 +452,7 @@ class TransactionFactoryTest extends TestCase
* @covers \FireflyIII\Factory\TransactionFactory
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
*/
public function testCreatePairDepositByName()
public function testCreatePairDepositByName(): void
{
// objects:
$asset = $this->user()->accounts()->where('account_type_id', 3)->first();
@@ -491,7 +509,11 @@ class TransactionFactoryTest extends TestCase
/** @var TransactionFactory $factory */
$factory = app(TransactionFactory::class);
$factory->setUser($this->user());
$collection = $factory->createPair($deposit, $data);
try {
$collection = $factory->createPair($deposit, $data);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$newCount = $deposit->transactions()->count();
@@ -515,7 +537,7 @@ class TransactionFactoryTest extends TestCase
* @covers \FireflyIII\Factory\TransactionFactory
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
*/
public function testCreatePairDepositCash()
public function testCreatePairDepositCash(): void
{
// objects:
$asset = $this->user()->accounts()->where('account_type_id', 3)->first();
@@ -573,7 +595,11 @@ class TransactionFactoryTest extends TestCase
/** @var TransactionFactory $factory */
$factory = app(TransactionFactory::class);
$factory->setUser($this->user());
$collection = $factory->createPair($deposit, $data);
try {
$collection = $factory->createPair($deposit, $data);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$newCount = $deposit->transactions()->count();
@@ -595,7 +621,7 @@ class TransactionFactoryTest extends TestCase
* @covers \FireflyIII\Factory\TransactionFactory
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
*/
public function testCreatePairForeign()
public function testCreatePairForeign(): void
{
// objects:
$asset = $this->user()->accounts()->where('account_type_id', 3)->first();
@@ -648,8 +674,11 @@ class TransactionFactoryTest extends TestCase
/** @var TransactionFactory $factory */
$factory = app(TransactionFactory::class);
$factory->setUser($this->user());
$collection = $factory->createPair($withdrawal, $data);
try {
$collection = $factory->createPair($withdrawal, $data);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$newCount = $withdrawal->transactions()->count();
$this->assertCount(2, $collection);
@@ -672,7 +701,7 @@ class TransactionFactoryTest extends TestCase
* @covers \FireflyIII\Factory\TransactionFactory
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
*/
public function testCreatePairReconciliation()
public function testCreatePairReconciliation(): void
{
// objects:
$asset = $this->user()->accounts()->where('account_type_id', 3)->first();
@@ -725,7 +754,11 @@ class TransactionFactoryTest extends TestCase
/** @var TransactionFactory $factory */
$factory = app(TransactionFactory::class);
$factory->setUser($this->user());
$collection = $factory->createPair($recon, $data);
try {
$collection = $factory->createPair($recon, $data);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$newCount = $recon->transactions()->count();
@@ -749,7 +782,7 @@ class TransactionFactoryTest extends TestCase
* @covers \FireflyIII\Factory\TransactionFactory
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
*/
public function testCreatePairTransfer()
public function testCreatePairTransfer(): void
{
// objects:
$asset = $this->user()->accounts()->where('account_type_id', 3)->first();
@@ -802,7 +835,11 @@ class TransactionFactoryTest extends TestCase
/** @var TransactionFactory $factory */
$factory = app(TransactionFactory::class);
$factory->setUser($this->user());
$collection = $factory->createPair($transfer, $data);
try {
$collection = $factory->createPair($transfer, $data);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$newCount = $transfer->transactions()->count();

View File

@@ -49,7 +49,7 @@ class TransactionJournalFactoryTest extends TestCase
* @covers \FireflyIII\Factory\TransactionJournalFactory
* @covers \FireflyIII\Services\Internal\Support\JournalServiceTrait
*/
public function testCreateBasic()
public function testCreateBasic(): void
{
// mock used classes:
$type = TransactionType::find(1);
@@ -111,7 +111,7 @@ class TransactionJournalFactoryTest extends TestCase
* @covers \FireflyIII\Factory\TransactionJournalFactory
* @covers \FireflyIII\Services\Internal\Support\JournalServiceTrait
*/
public function testCreateBasicMeta()
public function testCreateBasicMeta(): void
{
// mock used classes:
$type = TransactionType::find(1);

View File

@@ -37,7 +37,7 @@ class TransactionJournalMetaFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\TransactionJournalMetaFactory
*/
public function testUpdateOrCreateBasic()
public function testUpdateOrCreateBasic(): void
{
/** @var TransactionJournal $journal */
$journal = $this->user()->transactionJournals()->inRandomOrder()->first();
@@ -58,7 +58,7 @@ class TransactionJournalMetaFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\TransactionJournalMetaFactory
*/
public function testUpdateOrCreateDate()
public function testUpdateOrCreateDate(): void
{
/** @var TransactionJournal $journal */
$journal = $this->user()->transactionJournals()->inRandomOrder()->first();
@@ -79,7 +79,7 @@ class TransactionJournalMetaFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\TransactionJournalMetaFactory
*/
public function testUpdateOrCreateDeleteExisting()
public function testUpdateOrCreateDeleteExisting(): void
{
/** @var TransactionJournal $journal */
$journal = $this->user()->transactionJournals()->where('transaction_type_id', 3)->first();
@@ -90,6 +90,7 @@ class TransactionJournalMetaFactoryTest extends TestCase
'data' => 'bye!',
]
);
$count = $journal->transactionJournalMeta()->count();
$set = [
'journal' => $journal,
@@ -100,13 +101,13 @@ class TransactionJournalMetaFactoryTest extends TestCase
$factory = app(TransactionJournalMetaFactory::class);
$factory->updateOrCreate($set);
$this->assertEquals(0, $journal->transactionJournalMeta()->count());
$this->assertEquals($count-1, $journal->transactionJournalMeta()->count());
}
/**
* @covers \FireflyIII\Factory\TransactionJournalMetaFactory
*/
public function testUpdateOrCreateEmpty()
public function testUpdateOrCreateEmpty(): void
{
/** @var TransactionJournal $journal */
$journal = $this->user()->transactionJournals()->inRandomOrder()->first();
@@ -127,7 +128,7 @@ class TransactionJournalMetaFactoryTest extends TestCase
/**
* @covers \FireflyIII\Factory\TransactionJournalMetaFactory
*/
public function testUpdateOrCreateExistingEmpty()
public function testUpdateOrCreateExistingEmpty(): void
{
/** @var TransactionJournal $journal */
$journal = $this->user()->transactionJournals()->inRandomOrder()->first();

View File

@@ -42,7 +42,7 @@ class AdminEventHandlerTest extends TestCase
* @covers \FireflyIII\Handlers\Events\AdminEventHandler::sendTestMessage
* @covers \FireflyIII\Events\AdminRequestedTestMessage
*/
public function testSendNoMessage()
public function testSendNoMessage(): void
{
$repository = $this->mock(UserRepositoryInterface::class);
$event = new AdminRequestedTestMessage($this->user(), '127.0.0.1');
@@ -58,7 +58,7 @@ class AdminEventHandlerTest extends TestCase
* @covers \FireflyIII\Handlers\Events\AdminEventHandler::sendTestMessage
* @covers \FireflyIII\Events\AdminRequestedTestMessage
*/
public function testSendTestMessage()
public function testSendTestMessage(): void
{
Mail::fake();
$repository = $this->mock(UserRepositoryInterface::class);

View File

@@ -50,7 +50,7 @@ class UserEventHandlerTest extends TestCase
* @covers \FireflyIII\Handlers\Events\UserEventHandler::attachUserRole
* @covers \FireflyIII\Events\RegisteredUser
*/
public function testAttachUserRole()
public function testAttachUserRole(): void
{
$repository = $this->mock(UserRepositoryInterface::class);
$user = $this->emptyUser();
@@ -66,7 +66,7 @@ class UserEventHandlerTest extends TestCase
/**
* @covers \FireflyIII\Handlers\Events\UserEventHandler::checkSingleUserIsAdmin
*/
public function testCheckSingleUserIsAdminMulti()
public function testCheckSingleUserIsAdminMulti(): void
{
$repository = $this->mock(UserRepositoryInterface::class);
$user = $this->user();
@@ -84,7 +84,7 @@ class UserEventHandlerTest extends TestCase
/**
* @covers \FireflyIII\Handlers\Events\UserEventHandler::checkSingleUserIsAdmin
*/
public function testCheckSingleUserIsAdminNoRole()
public function testCheckSingleUserIsAdminNoRole(): void
{
$repository = $this->mock(UserRepositoryInterface::class);
$user = $this->emptyUser();
@@ -104,7 +104,7 @@ class UserEventHandlerTest extends TestCase
/**
* @covers \FireflyIII\Handlers\Events\UserEventHandler::checkSingleUserIsAdmin
*/
public function testCheckSingleUserIsAdminNotAdmin()
public function testCheckSingleUserIsAdminNotAdmin(): void
{
$repository = $this->mock(UserRepositoryInterface::class);
$user = $this->emptyUser();
@@ -123,7 +123,7 @@ class UserEventHandlerTest extends TestCase
/**
* @covers \FireflyIII\Handlers\Events\UserEventHandler::checkSingleUserIsAdmin
*/
public function testCheckSingleUserIsAdminSingle()
public function testCheckSingleUserIsAdminSingle(): void
{
$repository = $this->mock(UserRepositoryInterface::class);
$user = $this->user();
@@ -141,7 +141,7 @@ class UserEventHandlerTest extends TestCase
* @covers \FireflyIII\Handlers\Events\UserEventHandler::sendEmailChangeConfirmMail
* @covers \FireflyIII\Events\UserChangedEmail
*/
public function testSendEmailChangeConfirmMail()
public function testSendEmailChangeConfirmMail(): void
{
Mail::fake();
$user = $this->emptyUser();
@@ -164,7 +164,7 @@ class UserEventHandlerTest extends TestCase
* @covers \FireflyIII\Handlers\Events\UserEventHandler::sendEmailChangeUndoMail
* @covers \FireflyIII\Events\UserChangedEmail
*/
public function testSendEmailChangeUndoMail()
public function testSendEmailChangeUndoMail(): void
{
Mail::fake();
$user = $this->emptyUser();
@@ -188,7 +188,7 @@ class UserEventHandlerTest extends TestCase
* @covers \FireflyIII\Handlers\Events\UserEventHandler::sendNewPassword
* @covers \FireflyIII\Events\RequestedNewPassword
*/
public function testSendNewPassword()
public function testSendNewPassword(): void
{
Mail::fake();
$user = $this->emptyUser();
@@ -211,7 +211,7 @@ class UserEventHandlerTest extends TestCase
* @covers \FireflyIII\Handlers\Events\UserEventHandler::sendRegistrationMail
* @covers \FireflyIII\Events\RegisteredUser
*/
public function testSendRegistrationMail()
public function testSendRegistrationMail(): void
{
Mail::fake();
$user = $this->emptyUser();

View File

@@ -43,7 +43,7 @@ class VersionCheckEventHandlerTest extends TestCase
/**
*
*/
public function testCheckForUpdatesError()
public function testCheckForUpdatesError(): void
{
$updateConfig = new Configuration;
$updateConfig->data = 1;
@@ -73,7 +73,7 @@ class VersionCheckEventHandlerTest extends TestCase
* @covers \FireflyIII\Events\RequestedVersionCheckStatus
* @covers \FireflyIII\Handlers\Events\VersionCheckEventHandler
*/
public function testCheckForUpdatesNewer()
public function testCheckForUpdatesNewer(): void
{
$updateConfig = new Configuration;
$updateConfig->data = 1;
@@ -106,7 +106,7 @@ class VersionCheckEventHandlerTest extends TestCase
/**
*
*/
public function testCheckForUpdatesNoAdmin()
public function testCheckForUpdatesNoAdmin(): void
{
$updateConfig = new Configuration;
$updateConfig->data = 1;
@@ -125,7 +125,7 @@ class VersionCheckEventHandlerTest extends TestCase
/**
*
*/
public function testCheckForUpdatesNoPermission()
public function testCheckForUpdatesNoPermission(): void
{
$updateConfig = new Configuration;
$updateConfig->data = -1;
@@ -148,7 +148,7 @@ class VersionCheckEventHandlerTest extends TestCase
/**
*
*/
public function testCheckForUpdatesTooRecent()
public function testCheckForUpdatesTooRecent(): void
{
$updateConfig = new Configuration;
$updateConfig->data = 1;

View File

@@ -41,7 +41,7 @@ class AttachmentHelperTest extends TestCase
/**
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getAttachmentLocation
*/
public function testGetAttachmentLocation()
public function testGetAttachmentLocation(): void
{
$attachment = Attachment::first();
$helper = new AttachmentHelper;
@@ -61,7 +61,7 @@ class AttachmentHelperTest extends TestCase
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getMessages
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getErrors
*/
public function testInvalidMime()
public function testInvalidMime(): void
{
$journal = TransactionJournal::first();
$helper = new AttachmentHelper;
@@ -90,7 +90,7 @@ class AttachmentHelperTest extends TestCase
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getErrors
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getAttachments
*/
public function testSave()
public function testSave(): void
{
Storage::fake('upload');
@@ -118,7 +118,7 @@ class AttachmentHelperTest extends TestCase
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::__construct
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::saveAttachmentsForModel
*/
public function testSaveEmpty()
public function testSaveEmpty(): void
{
$journal = TransactionJournal::first();
$helper = new AttachmentHelper;
@@ -141,7 +141,7 @@ class AttachmentHelperTest extends TestCase
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getErrors
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getAttachments
*/
public function testSaveSecond()
public function testSaveSecond(): void
{
$journal = TransactionJournal::first();
$helper = new AttachmentHelper;

View File

@@ -48,7 +48,7 @@ class MetaPieChartTest extends TestCase
/**
* @covers \FireflyIII\Helpers\Chart\MetaPieChart
*/
public function testGenerateExpenseAccount()
public function testGenerateExpenseAccount(): void
{
$som = (new Carbon())->startOfMonth();
$eom = (new Carbon())->endOfMonth();
@@ -101,7 +101,7 @@ class MetaPieChartTest extends TestCase
/**
* @covers \FireflyIII\Helpers\Chart\MetaPieChart
*/
public function testGenerateExpenseAccountWithOthers()
public function testGenerateExpenseAccountWithOthers(): void
{
$som = (new Carbon())->startOfMonth();
$eom = (new Carbon())->endOfMonth();
@@ -160,7 +160,7 @@ class MetaPieChartTest extends TestCase
/**
* @covers \FireflyIII\Helpers\Chart\MetaPieChart
*/
public function testGenerateIncomeAccount()
public function testGenerateIncomeAccount(): void
{
$som = (new Carbon())->startOfMonth();
$eom = (new Carbon())->endOfMonth();
@@ -212,7 +212,7 @@ class MetaPieChartTest extends TestCase
/**
* @covers \FireflyIII\Helpers\Chart\MetaPieChart
*/
public function testGenerateIncomeAccountWithOthers()
public function testGenerateIncomeAccountWithOthers(): void
{
$som = (new Carbon())->startOfMonth();
$eom = (new Carbon())->endOfMonth();

View File

@@ -33,7 +33,7 @@ class AmountCreditTest extends TestCase
/**
* @covers \FireflyIII\Import\Converter\AmountCredit::convert()
*/
public function testConvert()
public function testConvert(): void
{
$values = [
'0' => '0',
@@ -161,7 +161,7 @@ class AmountCreditTest extends TestCase
/**
* @covers \FireflyIII\Import\Converter\AmountCredit::convert()
*/
public function testConvertNull()
public function testConvertNull(): void
{
$converter = new AmountCredit;
$result = $converter->convert(null);

View File

@@ -33,7 +33,7 @@ class AmountDebitTest extends TestCase
/**
* @covers \FireflyIII\Import\Converter\AmountDebit::convert()
*/
public function testConvert()
public function testConvert(): void
{
$values = [
'0' => '0',
@@ -161,7 +161,7 @@ class AmountDebitTest extends TestCase
/**
* @covers \FireflyIII\Import\Converter\AmountDebit::convert()
*/
public function testConvertNull()
public function testConvertNull(): void
{
$converter = new AmountDebit;
$result = $converter->convert(null);

View File

@@ -34,7 +34,7 @@ class AmountTest extends TestCase
* @covers \FireflyIII\Import\Converter\Amount::convert()
* @covers \FireflyIII\Import\Converter\Amount::stripAmount()
*/
public function testConvert()
public function testConvert(): void
{
$values = [
'0' => '0',
@@ -167,7 +167,7 @@ class AmountTest extends TestCase
/**
* @covers \FireflyIII\Import\Converter\Amount::convert()
*/
public function testConvertNull()
public function testConvertNull(): void
{
$converter = new Amount;
$result = $converter->convert(null);

View File

@@ -34,7 +34,7 @@ class INGDebitCreditTest extends TestCase
/**
* @covers \FireflyIII\Import\Converter\INGDebitCredit::convert()
*/
public function testConvertAf()
public function testConvertAf(): void
{
$converter = new INGDebitCredit;
$result = $converter->convert('Af');
@@ -44,7 +44,7 @@ class INGDebitCreditTest extends TestCase
/**
* @covers \FireflyIII\Import\Converter\INGDebitCredit::convert()
*/
public function testConvertAnything()
public function testConvertAnything(): void
{
$converter = new INGDebitCredit;
$result = $converter->convert('9083jkdkj');
@@ -54,7 +54,7 @@ class INGDebitCreditTest extends TestCase
/**
* @covers \FireflyIII\Import\Converter\INGDebitCredit::convert()
*/
public function testConvertBij()
public function testConvertBij(): void
{
$converter = new INGDebitCredit;
$result = $converter->convert('Bij');

View File

@@ -38,7 +38,7 @@ class AssetAccountIbansTest extends TestCase
/**
* @covers \FireflyIII\Import\Mapper\AssetAccountIbans::getMap()
*/
public function testGetMapBasic()
public function testGetMapBasic(): void
{
$one = new Account;
$one->id = 17;

View File

@@ -38,7 +38,7 @@ class AssetAccountsTest extends TestCase
/**
* @covers \FireflyIII\Import\Mapper\AssetAccounts::getMap()
*/
public function testGetMapBasic()
public function testGetMapBasic(): void
{
$one = new Account;
$one->id = 23;

View File

@@ -24,7 +24,6 @@ declare(strict_types=1);
namespace Tests\Unit\Import\Mapper;
use FireflyIII\Import\Mapper\Bills;
use FireflyIII\Models\Account;
use FireflyIII\Models\Bill;
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use Illuminate\Support\Collection;
@@ -38,7 +37,7 @@ class BillsTest extends TestCase
/**
* @covers \FireflyIII\Import\Mapper\Bills::getMap()
*/
public function testGetMapBasic()
public function testGetMapBasic(): void
{
$one = new Bill;
$one->id = 5;

View File

@@ -37,7 +37,7 @@ class BudgetsTest extends TestCase
/**
* @covers \FireflyIII\Import\Mapper\Budgets::getMap()
*/
public function testGetMapBasic()
public function testGetMapBasic(): void
{
$one = new Budget;
$one->id = 8;

View File

@@ -37,7 +37,7 @@ class CategoriesTest extends TestCase
/**
* @covers \FireflyIII\Import\Mapper\Categories::getMap()
*/
public function testGetMapBasic()
public function testGetMapBasic(): void
{
$one = new Category;
$one->id = 9;

View File

@@ -38,7 +38,7 @@ class OpposingAccountIbansTest extends TestCase
/**
* @covers \FireflyIII\Import\Mapper\OpposingAccountIbans::getMap()
*/
public function testGetMapBasic()
public function testGetMapBasic(): void
{
$one = new Account;
$one->id = 21;

View File

@@ -38,7 +38,7 @@ class OpposingAccountsTest extends TestCase
/**
* @covers \FireflyIII\Import\Mapper\OpposingAccounts::getMap()
*/
public function testGetMapBasic()
public function testGetMapBasic(): void
{
$one = new Account;
$one->id = 13;

View File

@@ -37,7 +37,7 @@ class TagsTest extends TestCase
/**
* @covers \FireflyIII\Import\Mapper\Tags::getMap()
*/
public function testGetMapBasic()
public function testGetMapBasic(): void
{
$one = new Tag;
$one->id = 12;

View File

@@ -37,7 +37,7 @@ class TransactionCurrenciesTest extends TestCase
/**
* @covers \FireflyIII\Import\Mapper\TransactionCurrencies::getMap()
*/
public function testGetMapBasic()
public function testGetMapBasic(): void
{
$one = new TransactionCurrency;
$one->id = 9;

View File

@@ -35,7 +35,7 @@ class TagsCommaTest extends TestCase
/**
* \FireflyIII\Import\MapperPreProcess\TagsComma::run
*/
public function testBasic()
public function testBasic(): void
{
$input = 'some,tags, with, spaces ,and,without,,';
$output = ['some', 'tags', 'with', 'spaces', 'and', 'without'];

View File

@@ -35,7 +35,7 @@ class TagsSpaceTest extends TestCase
/**
* \FireflyIII\Import\MapperPreProcess\TagsSpace::run
*/
public function testBasic()
public function testBasic(): void
{
$input = 'some tags with spaces,and without ';
$output = ['some', 'tags', 'with', 'spaces,and', 'without'];

View File

@@ -35,7 +35,7 @@ class AuthenticateTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\Authenticate
*/
public function testMiddleware()
public function testMiddleware(): void
{
Log::debug('Now at testMiddleware');
$response = $this->get('/_test/authenticate');
@@ -46,7 +46,7 @@ class AuthenticateTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\Authenticate
*/
public function testMiddlewareAjax()
public function testMiddlewareAjax(): void
{
Log::debug('Now at testMiddlewareAjax');
$server = ['HTTP_X-Requested-With' => 'XMLHttpRequest'];
@@ -57,7 +57,7 @@ class AuthenticateTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\Authenticate
*/
public function testMiddlewareAuth()
public function testMiddlewareAuth(): void
{
Log::debug('Now at testMiddlewareAuth');
$this->be($this->user());
@@ -68,7 +68,7 @@ class AuthenticateTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\Authenticate
*/
public function testMiddlewareBlockedUser()
public function testMiddlewareBlockedUser(): void
{
Log::debug('Now at testMiddlewareBlockedUser');
$user = $this->user();
@@ -85,7 +85,7 @@ class AuthenticateTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\Authenticate
*/
public function testMiddlewareEmail()
public function testMiddlewareEmail(): void
{
Log::debug('Now at testMiddlewareEmail');
$user = $this->user();

View File

@@ -38,7 +38,7 @@ class AuthenticateTwoFactorTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\AuthenticateTwoFactor::handle
*/
public function testMiddleware()
public function testMiddleware(): void
{
$this->withoutExceptionHandling();
$response = $this->get('/_test/authenticate');
@@ -56,7 +56,7 @@ class AuthenticateTwoFactorTest extends TestCase
*
* @covers \FireflyIII\Http\Middleware\AuthenticateTwoFactor::handle
*/
public function testMiddlewareNoTwoFA()
public function testMiddlewareNoTwoFA(): void
{
$this->withoutExceptionHandling();
$user = $this->user();
@@ -87,7 +87,7 @@ class AuthenticateTwoFactorTest extends TestCase
*
* @covers \FireflyIII\Http\Middleware\AuthenticateTwoFactor::handle
*/
public function testMiddlewareTwoFAAuthed()
public function testMiddlewareTwoFAAuthed(): void
{
$this->withoutExceptionHandling();
$user = $this->user();
@@ -120,7 +120,7 @@ class AuthenticateTwoFactorTest extends TestCase
*
* @covers \FireflyIII\Http\Middleware\AuthenticateTwoFactor::handle
*/
public function testMiddlewareTwoFANoSecret()
public function testMiddlewareTwoFANoSecret(): void
{
$this->withoutExceptionHandling();
$user = $this->user();
@@ -151,7 +151,7 @@ class AuthenticateTwoFactorTest extends TestCase
*
* @covers \FireflyIII\Http\Middleware\AuthenticateTwoFactor::handle
*/
public function testMiddlewareTwoFASecret()
public function testMiddlewareTwoFASecret(): void
{
$this->withoutExceptionHandling();
$user = $this->user();

View File

@@ -36,7 +36,7 @@ class IsAdminTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\IsAdmin::handle
*/
public function testMiddleware()
public function testMiddleware(): void
{
$this->withoutExceptionHandling();
$response = $this->get('/_test/is-admin');
@@ -47,7 +47,7 @@ class IsAdminTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\IsAdmin::handle
*/
public function testMiddlewareAjax()
public function testMiddlewareAjax(): void
{
$server = ['HTTP_X-Requested-With' => 'XMLHttpRequest'];
$this->withoutExceptionHandling();
@@ -58,7 +58,7 @@ class IsAdminTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\IsAdmin::handle
*/
public function testMiddlewareNotOwner()
public function testMiddlewareNotOwner(): void
{
$this->withoutExceptionHandling();
$this->be($this->emptyUser());
@@ -70,7 +70,7 @@ class IsAdminTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\IsAdmin::handle
*/
public function testMiddlewareOwner()
public function testMiddlewareOwner(): void
{
$this->be($this->user());
$this->withoutExceptionHandling();

View File

@@ -37,7 +37,7 @@ class IsDemoUserTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\IsDemoUser
*/
public function testMiddlewareAuthenticated()
public function testMiddlewareAuthenticated(): void
{
$this->be($this->user());
$response = $this->get('/_test/is-demo');
@@ -47,7 +47,7 @@ class IsDemoUserTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\IsDemoUser
*/
public function testMiddlewareNotAuthenticated()
public function testMiddlewareNotAuthenticated(): void
{
$response = $this->get('/_test/is-demo');
$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
@@ -56,7 +56,7 @@ class IsDemoUserTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\IsDemoUser
*/
public function testMiddlewareIsDemoUser()
public function testMiddlewareIsDemoUser(): void
{
$this->be($this->demoUser());
$response = $this->get('/_test/is-demo');

View File

@@ -36,7 +36,7 @@ class IsSandstormUserTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\IsSandStormUser::handle
*/
public function testMiddlewareNotAuthenticated()
public function testMiddlewareNotAuthenticated(): void
{
$this->withoutExceptionHandling();
$response = $this->get('/_test/is-sandstorm');
@@ -46,7 +46,7 @@ class IsSandstormUserTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\IsSandStormUser::handle
*/
public function testMiddlewareNotSandStorm()
public function testMiddlewareNotSandStorm(): void
{
$this->withoutExceptionHandling();
$this->be($this->user());
@@ -57,7 +57,7 @@ class IsSandstormUserTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\IsSandStormUser::handle
*/
public function testMiddlewareSandstorm()
public function testMiddlewareSandstorm(): void
{
putenv('SANDSTORM=1');
$this->withoutExceptionHandling();

View File

@@ -38,7 +38,7 @@ class RangeTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\Range
*/
public function testMiddlewareAuthenticated()
public function testMiddlewareAuthenticated(): void
{
$repository = $this->mock(JournalRepositoryInterface::class);
$repository->shouldReceive('firstNull')->andReturn(TransactionJournal::first());
@@ -56,7 +56,7 @@ class RangeTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\Range
*/
public function testMiddlewareNotAuthenticated()
public function testMiddlewareNotAuthenticated(): void
{
$this->withoutExceptionHandling();
$response = $this->get('/_test/range');

View File

@@ -38,7 +38,7 @@ class RedirectIf2FAAuthenticatedTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\RedirectIfTwoFactorAuthenticated::handle
*/
public function testMiddleware()
public function testMiddleware(): void
{
$response = $this->get('/_test/authenticate');
$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
@@ -47,7 +47,7 @@ class RedirectIf2FAAuthenticatedTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\RedirectIfTwoFactorAuthenticated::handle
*/
public function testMiddlewareAuthenticated()
public function testMiddlewareAuthenticated(): void
{
// pref for has 2fa is true
$preference = new Preference;
@@ -71,7 +71,7 @@ class RedirectIf2FAAuthenticatedTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\RedirectIfTwoFactorAuthenticated::handle
*/
public function testMiddlewareLightAuth()
public function testMiddlewareLightAuth(): void
{
$this->be($this->user());
$response = $this->get('/_test/authenticate');

View File

@@ -36,7 +36,7 @@ class RedirectIfAuthenticatedTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\RedirectIfAuthenticated::handle
*/
public function testMiddleware()
public function testMiddleware(): void
{
$response = $this->get('/_test/authenticate');
$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
@@ -45,7 +45,7 @@ class RedirectIfAuthenticatedTest extends TestCase
/**
* @covers \FireflyIII\Http\Middleware\RedirectIfAuthenticated::handle
*/
public function testMiddlewareAuthenticated()
public function testMiddlewareAuthenticated(): void
{
$this->be($this->user());
$response = $this->get('/_test/authenticate');

View File

@@ -37,7 +37,7 @@ class AccountDestroyServiceTest extends TestCase
/**
* @covers \FireflyIII\Services\Internal\Destroy\AccountDestroyService
*/
public function testDestroyBasic()
public function testDestroyBasic(): void
{
$account = Account::create(
['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . random_int(1, 1000),
@@ -53,7 +53,7 @@ class AccountDestroyServiceTest extends TestCase
/**
* @covers \FireflyIII\Services\Internal\Destroy\AccountDestroyService
*/
public function testDestroyDontMove()
public function testDestroyDontMove(): void
{
// create objects:
$account = Account::create(
@@ -76,7 +76,7 @@ class AccountDestroyServiceTest extends TestCase
/**
* @covers \FireflyIII\Services\Internal\Destroy\AccountDestroyService
*/
public function testDestroyMove()
public function testDestroyMove(): void
{
$account = Account::create(
['user_id' => $this->user()->id, 'account_type_id' => 1, 'name' => 'Some name #' . random_int(1, 1000),

View File

@@ -42,7 +42,7 @@ class AccountUpdateServiceTest extends TestCase
* @covers \FireflyIII\Services\Internal\Update\AccountUpdateService
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testDeleteExistingIB()
public function testDeleteExistingIB(): void
{
/** @var Account $account */
$account = Account::create(
@@ -91,7 +91,7 @@ class AccountUpdateServiceTest extends TestCase
* @covers \FireflyIII\Services\Internal\Update\AccountUpdateService
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testUpdateBasic()
public function testUpdateBasic(): void
{
/** @var Account $account */
$account = $this->user()->accounts()->first();
@@ -114,7 +114,7 @@ class AccountUpdateServiceTest extends TestCase
* @covers \FireflyIII\Services\Internal\Update\AccountUpdateService
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testUpdateBasicEmptyNote()
public function testUpdateBasicEmptyNote(): void
{
/** @var Account $account */
$account = $this->user()->accounts()->first();
@@ -139,7 +139,7 @@ class AccountUpdateServiceTest extends TestCase
* @covers \FireflyIII\Services\Internal\Update\AccountUpdateService
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testUpdateBasicExistingNote()
public function testUpdateBasicExistingNote(): void
{
/** @var Account $account */
$account = $this->user()->accounts()->first();
@@ -170,7 +170,7 @@ class AccountUpdateServiceTest extends TestCase
* @covers \FireflyIII\Services\Internal\Update\AccountUpdateService
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testUpdateExistingIB()
public function testUpdateExistingIB(): void
{
/** @var Account $account */
$account = Account::create(
@@ -222,7 +222,7 @@ class AccountUpdateServiceTest extends TestCase
* @covers \FireflyIII\Services\Internal\Update\AccountUpdateService
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testUpdateExistingIBZero()
public function testUpdateExistingIBZero(): void
{
$deleteService = $this->mock(JournalDestroyService::class);
$deleteService->shouldReceive('destroy')->once();
@@ -277,7 +277,7 @@ class AccountUpdateServiceTest extends TestCase
* @covers \FireflyIII\Services\Internal\Update\AccountUpdateService
* @covers \FireflyIII\Services\Internal\Support\AccountServiceTrait
*/
public function testUpdateNewIB()
public function testUpdateNewIB(): void
{
/** @var Account $account */
$account = Account::create(

View File

@@ -44,7 +44,7 @@ class JournalUpdateServiceTest extends TestCase
* @covers \FireflyIII\Services\Internal\Update\JournalUpdateService
* @covers \FireflyIII\Services\Internal\Support\JournalServiceTrait
*/
public function testUpdateBasic()
public function testUpdateBasic(): void
{
// mock other stuff:
$transactionFactory = $this->mock(TransactionFactory::class);
@@ -86,7 +86,7 @@ class JournalUpdateServiceTest extends TestCase
* @covers \FireflyIII\Services\Internal\Update\JournalUpdateService
* @covers \FireflyIII\Services\Internal\Support\JournalServiceTrait
*/
public function testUpdateBasicEmptyNote()
public function testUpdateBasicEmptyNote(): void
{
// mock other stuff:
$transactionFactory = $this->mock(TransactionFactory::class);
@@ -128,7 +128,7 @@ class JournalUpdateServiceTest extends TestCase
/**
* @covers \FireflyIII\Services\Internal\Update\JournalUpdateService
*/
public function testUpdateBudget()
public function testUpdateBudget(): void
{
$budget = $this->user()->budgets()->first();
$service = $this->mock(TransactionUpdateService::class);
@@ -151,7 +151,7 @@ class JournalUpdateServiceTest extends TestCase
/**
* @covers \FireflyIII\Services\Internal\Update\JournalUpdateService
*/
public function testUpdateCategory()
public function testUpdateCategory(): void
{
$service = $this->mock(TransactionUpdateService::class);
$service->shouldReceive('setUser');
@@ -175,7 +175,7 @@ class JournalUpdateServiceTest extends TestCase
* @covers \FireflyIII\Services\Internal\Update\JournalUpdateService
* @covers \FireflyIII\Services\Internal\Support\JournalServiceTrait
*/
public function testUpdateLotsOfTransactions()
public function testUpdateLotsOfTransactions(): void
{
// mock other stuff:
$transactionFactory = $this->mock(TransactionFactory::class);

View File

@@ -39,7 +39,7 @@ class TransactionUpdateServiceTest extends TestCase
/**
* @covers \FireflyIII\Services\Internal\Update\TransactionUpdateService
*/
public function testReconcile()
public function testReconcile(): void
{
$transaction = $this->user()->transactions()->inRandomOrder()->first();
@@ -55,7 +55,7 @@ class TransactionUpdateServiceTest extends TestCase
* @covers \FireflyIII\Services\Internal\Update\TransactionUpdateService
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
*/
public function testReconcileNull()
public function testReconcileNull(): void
{
/** @var TransactionUpdateService $service */
$service = app(TransactionUpdateService::class);
@@ -68,7 +68,7 @@ class TransactionUpdateServiceTest extends TestCase
* @covers \FireflyIII\Services\Internal\Update\TransactionUpdateService
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
*/
public function testUpdateBudget()
public function testUpdateBudget(): void
{
/** @var Transaction $source */
@@ -92,7 +92,7 @@ class TransactionUpdateServiceTest extends TestCase
* @covers \FireflyIII\Services\Internal\Update\TransactionUpdateService
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
*/
public function testUpdateCategory()
public function testUpdateCategory(): void
{
/** @var Transaction $source */
@@ -116,7 +116,7 @@ class TransactionUpdateServiceTest extends TestCase
* @covers \FireflyIII\Services\Internal\Update\TransactionUpdateService
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
*/
public function testUpdateDestinationBasic()
public function testUpdateDestinationBasic(): void
{
/** @var Transaction $source */
$source = $this->user()->transactions()->where('amount', '>', 0)->inRandomOrder()->first();
@@ -155,7 +155,7 @@ class TransactionUpdateServiceTest extends TestCase
* @covers \FireflyIII\Services\Internal\Update\TransactionUpdateService
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
*/
public function testUpdateDestinationForeign()
public function testUpdateDestinationForeign(): void
{
/** @var Transaction $source */
$source = $this->user()->transactions()->where('amount', '>', 0)->inRandomOrder()->first();
@@ -198,7 +198,7 @@ class TransactionUpdateServiceTest extends TestCase
* @covers \FireflyIII\Services\Internal\Update\TransactionUpdateService
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
*/
public function testUpdateSourceBasic()
public function testUpdateSourceBasic(): void
{
/** @var Transaction $source */
$source = $this->user()->transactions()->where('amount', '<', 0)->inRandomOrder()->first();

View File

@@ -26,6 +26,7 @@ namespace Tests\Unit\Support\Import\Configuration\File;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Import\Mapper\Budgets;
use FireflyIII\Import\MapperPreProcess\TagsSpace;
use FireflyIII\Import\Specifics\IngDescription;
use FireflyIII\Models\Attachment;
use FireflyIII\Models\ImportJob;
@@ -333,7 +334,7 @@ class ConfigureMappingHandlerTest extends TestCase
$job->save();
$combinations = [
['role' => 'tags-space', 'expected' => '\\FireflyIII\\Import\\MapperPreProcess\\TagsSpace'], // tags- space has a pre-processor. Return it.
['role' => 'tags-space', 'expected' => TagsSpace::class], // tags- space has a pre-processor. Return it.
['role' => 'description', 'expected' => ''], // description has not.
['role' => 'no-such-role', 'expected' => ''], // not existing role has not.
];

View File

@@ -0,0 +1,748 @@
<?php
/**
* ImportTransactionTest.php
* Copyright (c) 2018 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Unit\Support\Import\Placeholder;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Support\Import\Placeholder\ColumnValue;
use FireflyIII\Support\Import\Placeholder\ImportTransaction;
use Tests\TestCase;
/**
* Class ImportTransactionTest
*/
class ImportTransactionTest extends TestCase
{
/**
* Test what happens when you set the account-id using a ColumnValue.
* Since this field can be mapped. Test with both the mapped and unmapped variant.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testACVAccountIdMapped(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('account-id');
$columnValue->setOriginalRole('account-name');
$columnValue->setValue('Checking Account');
$columnValue->setMappedValue(1);
$importTransaction = new ImportTransaction;
$this->assertEquals(0, $importTransaction->accountId);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals($columnValue->getMappedValue(), $importTransaction->accountId);
}
/**
* Test what happens when you set the account-id using a ColumnValue.
* Since this field can be mapped. Test with both the mapped and unmapped variant.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testACVAccountIdUnmapped(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('account-id');
$columnValue->setValue('1');
$importTransaction = new ImportTransaction;
$this->assertEquals(0, $importTransaction->accountId);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals((int)$columnValue->getValue(), $importTransaction->accountId);
}
/**
* Test what happens when you set the bill-id using a ColumnValue.
* Since this field can be mapped. Test with both the mapped and unmapped variant.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testACVBillIdMapped(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('bill-id');
$columnValue->setOriginalRole('bill-name');
$columnValue->setValue('Some Bill');
$columnValue->setMappedValue(2);
$importTransaction = new ImportTransaction;
$this->assertEquals(0, $importTransaction->billId);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals($columnValue->getMappedValue(), $importTransaction->billId);
}
/**
* Test what happens when you set the bill-id using a ColumnValue.
* Since this field can be mapped. Test with both the mapped and unmapped variant.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testACVBillIdUnmapped(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('bill-id');
$columnValue->setValue('2');
$importTransaction = new ImportTransaction;
$this->assertEquals(0, $importTransaction->billId);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals((int)$columnValue->getValue(), $importTransaction->billId);
}
/**
* Test what happens when you set the budget-id using a ColumnValue.
* Since this field can be mapped. Test with both the mapped and unmapped variant.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testACVBudgetIdMapped(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('budget-id');
$columnValue->setOriginalRole('budget-name');
$columnValue->setValue('Some Budget');
$columnValue->setMappedValue(3);
$importTransaction = new ImportTransaction;
$this->assertEquals(0, $importTransaction->budgetId);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals($columnValue->getMappedValue(), $importTransaction->budgetId);
}
/**
* Test what happens when you set the budget-id using a ColumnValue.
* Since this field can be mapped. Test with both the mapped and unmapped variant.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testACVBudgetIdUnmapped(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('budget-id');
$columnValue->setValue('3');
$importTransaction = new ImportTransaction;
$this->assertEquals(0, $importTransaction->budgetId);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals((int)$columnValue->getValue(), $importTransaction->budgetId);
}
/**
* Test what happens when you set the category-id using a ColumnValue.
* Since this field can be mapped. Test with both the mapped and unmapped variant.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testACVCategoryIdMapped(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('category-id');
$columnValue->setOriginalRole('category-name');
$columnValue->setValue('Some category');
$columnValue->setMappedValue(5);
$importTransaction = new ImportTransaction;
$this->assertEquals(0, $importTransaction->categoryId);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals($columnValue->getMappedValue(), $importTransaction->categoryId);
}
/**
* Test what happens when you set the category-id using a ColumnValue.
* Since this field can be mapped. Test with both the mapped and unmapped variant.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testACVCategoryIdUnmapped(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('category-id');
$columnValue->setValue('5');
$importTransaction = new ImportTransaction;
$this->assertEquals(0, $importTransaction->categoryId);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals((int)$columnValue->getValue(), $importTransaction->categoryId);
}
/**
* Test what happens when you set the currency-id using a ColumnValue.
* Since this field can be mapped. Test with both the mapped and unmapped variant.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testACVCurrencyIdMapped(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('currency-id');
$columnValue->setOriginalRole('currency-code');
$columnValue->setValue('EUR');
$columnValue->setMappedValue(4);
$importTransaction = new ImportTransaction;
$this->assertEquals(0, $importTransaction->currencyId);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals($columnValue->getMappedValue(), $importTransaction->currencyId);
}
/**
* Test what happens when you set the currency-id using a ColumnValue.
* Since this field can be mapped. Test with both the mapped and unmapped variant.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testACVCurrencyIdUnmapped(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('currency-id');
$columnValue->setValue('4');
$importTransaction = new ImportTransaction;
$this->assertEquals(0, $importTransaction->currencyId);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals((int)$columnValue->getValue(), $importTransaction->currencyId);
}
/**
* Test what happens when you set the foreign-currency-id using a ColumnValue.
* Since this field can be mapped. Test with both the mapped and unmapped variant.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testACVForeignCurrencyIdMapped(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('foreign-currency-id');
$columnValue->setOriginalRole('foreign-currency-code');
$columnValue->setValue('USD');
$columnValue->setMappedValue(6);
$importTransaction = new ImportTransaction;
$this->assertEquals(0, $importTransaction->foreignCurrencyId);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals($columnValue->getMappedValue(), $importTransaction->foreignCurrencyId);
}
/**
* Test what happens when you set the category-id using a ColumnValue.
* Since this field can be mapped. Test with both the mapped and unmapped variant.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testACVForeignCurrencyIdUnmapped(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('foreign-currency-id');
$columnValue->setValue('6');
$importTransaction = new ImportTransaction;
$this->assertEquals(0, $importTransaction->foreignCurrencyId);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals((int)$columnValue->getValue(), $importTransaction->foreignCurrencyId);
}
/**
* Test what happens when you set the opposing-id using a ColumnValue.
* Since this field can be mapped. Test with both the mapped and unmapped variant.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testACVOpposingIdMapped(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('opposing-id');
$columnValue->setOriginalRole('opposing-name');
$columnValue->setValue('Some Opposing');
$columnValue->setMappedValue(7);
$importTransaction = new ImportTransaction;
$this->assertEquals(0, $importTransaction->opposingId);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals($columnValue->getMappedValue(), $importTransaction->opposingId);
}
/**
* Test what happens when you set the opposing-id using a ColumnValue.
* Since this field can be mapped. Test with both the mapped and unmapped variant.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testACVOpposingIdUnmapped(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('opposing-id');
$columnValue->setValue('7');
$importTransaction = new ImportTransaction;
$this->assertEquals(0, $importTransaction->opposingId);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals((int)$columnValue->getValue(), $importTransaction->opposingId);
}
/**
* Test various unmapped fields, and the result that the ImportTransaction should display.
*
* Put into one big test to save time.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testACVOtherValues(): void
{
$tests = [
'account-iban' => 'accountIban',
'account-name' => 'accountName',
'account-bic' => 'accountBic',
'account-number' => 'accountNumber',
'amount_debit' => 'amountDebit',
'amount_credit' => 'amountCredit',
'amount' => 'amount',
'amount_foreign' => 'foreignAmount',
'bill-name' => 'billName',
'budget-name' => 'budgetName',
'category-name' => 'categoryName',
'currency-code' => 'currencyCode',
'currency-name' => 'currencyName',
'currency-symbol' => 'currencySymbol',
'external-id' => 'externalId',
'foreign-currency-code' => 'foreignCurrencyCode',
'date-transaction' => 'date',
'opposing-iban' => 'opposingIban',
'opposing-name' => 'opposingName',
'opposing-bic' => 'opposingBic',
'opposing-number' => 'opposingNumber',
];
foreach ($tests as $role => $field) {
// generate random value
$value = bin2hex(random_bytes(16));
// put into column value:
$columnValue = new ColumnValue;
$columnValue->setRole($role);
$columnValue->setValue($value);
// first test should always return NULL
$importTransaction = new ImportTransaction;
$this->assertNull($importTransaction->$field);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
// after setting, should return value.
$this->assertEquals($value, $importTransaction->$field);
}
}
/**
* Basic amount info. Should return something like '1.0'.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testCalculateAmountBasic(): void
{
$importTransaction = new ImportTransaction;
$importTransaction->amount = '1.23';
try {
$this->assertEquals('1.23', $importTransaction->calculateAmount());
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
}
/**
* Basic amount info. Should return something like '1.0'.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testCalculateAmountCredit(): void
{
$importTransaction = new ImportTransaction;
$importTransaction->amountCredit = '1.56';
try {
$this->assertEquals('1.56', $importTransaction->calculateAmount());
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
}
/**
* Basic amount info. Should return something like '1.0'.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testCalculateAmountDebit(): void
{
$importTransaction = new ImportTransaction;
$importTransaction->amountDebit = '1.01';
try {
$this->assertEquals('-1.01', $importTransaction->calculateAmount());
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
}
/**
* With no amount data, object should return ''
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testCalculateAmountEmpty(): void
{
$importTransaction = new ImportTransaction;
try {
$this->assertEquals('', $importTransaction->calculateAmount());
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
}
/**
* Basic amount info with negative modifier (Rabobank D)
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testCalculateAmountNeg(): void
{
$importTransaction = new ImportTransaction;
$importTransaction->amount = '2.99';
$importTransaction->modifiers['rabo-debit-credit'] = 'D';
try {
$this->assertEquals('-2.99', $importTransaction->calculateAmount());
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
}
/**
* Basic amount info with positive modifier (Rabobank C)
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testCalculateAmountPos(): void
{
$importTransaction = new ImportTransaction;
$importTransaction->amount = '-2.17';
$importTransaction->modifiers['rabo-debit-credit'] = 'C';
try {
$this->assertEquals('2.17', $importTransaction->calculateAmount());
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
}
/**
* Debit Credit indicator is special.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testDebitCredit(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('ing-debit-credit');
$columnValue->setValue('Af');
$importTransaction = new ImportTransaction;
$this->assertCount(0, $importTransaction->modifiers);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertCount(1, $importTransaction->modifiers);
$this->assertEquals('Af', $importTransaction->modifiers['ing-debit-credit']);
}
/**
* Description should be appended.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testDescription(): void
{
$one = new ColumnValue;
$one->setRole('description');
$one->setValue('A');
$two = new ColumnValue;
$two->setRole('description');
$two->setValue('B');
$importTransaction = new ImportTransaction;
$this->assertEquals('', $importTransaction->description);
try {
$importTransaction->addColumnValue($one);
$importTransaction->addColumnValue($two);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals('A B', $importTransaction->description);
}
/**
* Basic foreign amount info. Should return something like '1.0'.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testForeignAmountBasic(): void
{
$importTransaction = new ImportTransaction;
$importTransaction->foreignAmount = '1.23';
$this->assertEquals('1.23', $importTransaction->calculateForeignAmount());
}
/**
* Basic foreign amount info. Should return something like '1.0'.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testForeignAmountEmpty(): void
{
$importTransaction = new ImportTransaction;
$this->assertEquals('', $importTransaction->calculateForeignAmount());
}
/**
* Foreign amount with modifier that should make it negative again.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testForeignAmountModNeg(): void
{
$importTransaction = new ImportTransaction;
$importTransaction->foreignAmount = '6.77';
$importTransaction->modifiers['rabo-debit-credit'] = 'D';
$this->assertEquals('-6.77', $importTransaction->calculateForeignAmount());
}
/**
* Foreign amount with modifier that should make it positive again.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testForeignAmountModPos(): void
{
$importTransaction = new ImportTransaction;
$importTransaction->foreignAmount = '-5.77';
$importTransaction->modifiers['rabo-debit-credit'] = 'C';
$this->assertEquals('5.77', $importTransaction->calculateForeignAmount());
}
/**
* Basic foreign amount info. Should return something like '1.0'.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testForeignAmountNeg(): void
{
$importTransaction = new ImportTransaction;
$importTransaction->foreignAmount = '-4.56';
$this->assertEquals('-4.56', $importTransaction->calculateForeignAmount());
}
/**
* Ignore field must be ignored.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testIgnore(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('_ignore');
$columnValue->setValue('Bla bla bla');
$importTransaction = new ImportTransaction;
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertTrue(true);
}
/**
* Set a meta value, see what happens. Any will do.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testMetaValue(): void
{
$columnValue = new ColumnValue;
$columnValue->setRole('date-process');
$columnValue->setValue('2018-01-01');
$importTransaction = new ImportTransaction;
$this->assertCount(0, $importTransaction->meta);
try {
$importTransaction->addColumnValue($columnValue);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertCount(1, $importTransaction->meta);
$this->assertEquals($columnValue->getValue(), $importTransaction->meta['date-process']);
}
/**
* Description should be appended.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testNote(): void
{
$one = new ColumnValue;
$one->setRole('note');
$one->setValue('A');
$two = new ColumnValue;
$two->setRole('note');
$two->setValue('B');
$importTransaction = new ImportTransaction;
$this->assertEquals('', $importTransaction->note);
try {
$importTransaction->addColumnValue($one);
$importTransaction->addColumnValue($two);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals('A B', $importTransaction->note);
}
/**
* Test tags with a comma separator
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testTagsComma(): void
{
$one = new ColumnValue;
$one->setRole('tags-comma');
$one->setValue('a,b,c');
$two = new ColumnValue;
$two->setRole('tags-comma');
$two->setValue('d,e,c');
$importTransaction = new ImportTransaction;
$this->assertCount(0, $importTransaction->tags);
try {
$importTransaction->addColumnValue($one);
$importTransaction->addColumnValue($two);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertCount(5, $importTransaction->tags);
$this->assertEquals('a', $importTransaction->tags[0]);
}
/**
* Test tags with a space separator
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testTagsSpace(): void
{
$one = new ColumnValue;
$one->setRole('tags-space');
$one->setValue('a b c');
$two = new ColumnValue;
$two->setRole('tags-space');
$two->setValue('d e c');
$importTransaction = new ImportTransaction;
$this->assertCount(0, $importTransaction->tags);
try {
$importTransaction->addColumnValue($one);
$importTransaction->addColumnValue($two);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertCount(5, $importTransaction->tags);
$this->assertEquals('a', $importTransaction->tags[0]);
}
}

View File

@@ -0,0 +1,64 @@
<?php
/**
* ImportableCreatorTest.php
* Copyright (c) 2018 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Unit\Support\Import\Routine\File;
use FireflyIII\Support\Import\Placeholder\ColumnValue;
use FireflyIII\Support\Import\Placeholder\ImportTransaction;
use FireflyIII\Support\Import\Routine\File\ImportableCreator;
use Tests\TestCase;
/**
* Class ImportableCreatorTest
*/
class ImportableCreatorTest extends TestCase
{
/**
* @covers \FireflyIII\Support\Import\Routine\File\ImportableCreator
*/
public function testConvertSets(): void
{
$columnValue =new ColumnValue();
$columnValue->setOriginalRole('account-name');
$columnValue->setRole('account-id');
$columnValue->setValue('Checking Account');
$columnValue->setMappedValue(1);
$input = [
[
$columnValue
]
];
$creator = new ImportableCreator;
$result = $creator->convertSets($input);
$this->assertCount(1, $result);
$this->assertInstanceOf(ImportTransaction::class, $result[0]);
$this->assertEquals(1, $result[0]->accountId);
}
}

View File

@@ -0,0 +1,102 @@
<?php
/**
* LineReaderTest.php
* Copyright (c) 2018 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Unit\Support\Import\Routine\File;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Import\Specifics\IngDescription;
use FireflyIII\Models\Attachment;
use FireflyIII\Models\ImportJob;
use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
use FireflyIII\Support\Import\Routine\File\LineReader;
use Illuminate\Support\Collection;
use Tests\TestCase;
/**
* Class LineReaderTest
*/
class LineReaderTest extends TestCase
{
/**
* @covers \FireflyIII\Support\Import\Routine\File\LineReader
*/
public function testGetLines(): void
{
$job = new ImportJob;
$job->user_id = $this->user()->id;
$job->key = 'linerA' . random_int(1, 1000);
$job->status = 'new';
$job->stage = 'new';
$job->provider = 'fake';
$job->file_type = '';
$job->configuration = [
'specifics' => [
'IngDescription' => 1,
'BadSpecific' => 1,
],
'has-headers' => true,
'delimiter' => ',',
];
$job->save();
$att = new Attachment;
$att->filename = 'import_file';
$att->user_id = $this->user()->id;
$att->attachable_id = $job->id;
$att->attachable_type = Attachment::class;
$att->md5 = md5('hello');
$att->mime = 'fake';
$att->size = 3;
$att->save();
// mock repositories:
$repository = $this->mock(ImportJobRepositoryInterface::class);
$attachments = $this->mock(AttachmentHelperInterface::class);
$specific = $this->mock(IngDescription::class);
// fake file content:
$content = "header1,header2,header3\ncolumn1,column2,column3\nA,B,C";
$specifics = [['column1', 'column2', 'column3'], ['A', 'B', 'C']];
// mock calls and returns:
$repository->shouldReceive('setUser')->once();
$repository->shouldReceive('getAttachments')->once()->andReturn(new Collection([$att]));
$attachments->shouldReceive('getAttachmentContent')->andReturn($content)->once();
$repository->shouldReceive('getConfiguration')->once()->andReturn($job->configuration);
// expect the rows to be run throught the specific.
$specific->shouldReceive('run')->withArgs([$specifics[0]])->andReturn($specifics[0])->once();
$specific->shouldReceive('run')->withArgs([$specifics[1]])->andReturn($specifics[1])->once();
$lineReader = new LineReader;
$lineReader->setImportJob($job);
try {
$lines = $lineReader->getLines();
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertEquals($specifics, $lines);
}
}

View File

@@ -0,0 +1,154 @@
<?php
/**
* MappingConvergerTest.php
* Copyright (c) 2018 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Unit\Support\Import\Routine\File;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\ImportJob;
use FireflyIII\Support\Import\Routine\File\MappingConverger;
use Tests\TestCase;
/**
* Class MappingConvergerTest
*/
class MappingConvergerTest extends TestCase
{
/**
* @covers \FireflyIII\Support\Import\Routine\File\MappingConverger
*/
public function testConverge(): void
{
// configuration
$config = [
'column-roles' => [
0 => 'account-name',
1 => 'bill-name',
2 => 'budget-name',
3 => 'currency-code',
4 => 'category-name',
5 => 'foreign-currency-code',
6 => 'opposing-number',
7 => 'description',
8 => 'opposing-iban',
],
'column-mapping-config' => [
0 => [
'Checking Account' => 1,
],
1 => [
'BillX' => 2,
],
2 => [
'BudgetX' => 2,
],
3 => [
'EUR' => 7,
],
4 => [
'CategoryX' => 2,
],
5 => [
'USD' => 4,
],
6 => [
'SomeNumber' => 3,
],
8 => [
'IBANX' => 2,
],
],
'column-do-mapping' => [
0 => true,
1 => true,
2 => true,
3 => true,
4 => true,
5 => true,
6 => true,
7 => false,
8 => false,
],
];
// just one line to process (should hit everything).
$lines = [
[
0 => 'Checking Account',
1 => 'BillX',
2 => 'BudgetX',
3 => 'EUR',
4 => 'CategoryX',
5 => 'USD',
6 => 'SomeNumber',
7 => 'I am a description',
8 => 'IBANX'
],
[
0 => 'CheckingX Account',
1 => 'BillXA',
2 => 'BudgetBX',
3 => 'EUD',
4 => 'CategoryX',
5 => 'USA',
6 => 'SomeANumber',
7 => 'I am X description',
8 => 'IBANXX'
],
];
$job = new ImportJob;
$job->user_id = $this->user()->id;
$job->key = 'linerA' . random_int(1, 1000);
$job->status = 'new';
$job->stage = 'new';
$job->provider = 'fake';
$job->file_type = '';
$job->configuration = $config;
$job->save();
$converger = new MappingConverger;
$converger->setImportJob($job);
try {
$result = $converger->converge($lines);
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
// do some comparing, we know what to expect.
// line 0, column 0 is the account name.
$this->assertEquals($lines[0][0], $result[0][0]->getValue());
$this->assertEquals($config['column-roles'][0], $result[0][0]->getOriginalRole());
$this->assertEquals('account-id', $result[0][0]->getRole()); // role changed due to mapping.
$this->assertEquals(1, $result[0][0]->getMappedValue()); // can see which value it was given.
// line 1, column 0 is the account name, but it could not be mapped.
$this->assertEquals($lines[1][0], $result[1][0]->getValue());
$this->assertEquals($config['column-roles'][0], $result[1][0]->getOriginalRole());
$this->assertEquals($config['column-roles'][0], $result[1][0]->getRole()); // role did not change, no mapping.
$this->assertEquals(0, $result[1][0]->getMappedValue()); // value of mapping is 0.
}
}

View File

@@ -37,7 +37,7 @@ class AddTagTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\AddTag::__construct
* @covers \FireflyIII\TransactionRules\Actions\AddTag::act()
*/
public function testActExistingTag()
public function testActExistingTag(): void
{
$tag = Tag::inRandomOrder()->whereNull('deleted_at')->first();
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
@@ -55,7 +55,7 @@ class AddTagTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Actions\AddTag::act()
*/
public function testActNoTag()
public function testActNoTag(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$ruleAction = new RuleAction;

View File

@@ -36,7 +36,7 @@ class AppendDescriptionTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\AppendDescription::__construct
* @covers \FireflyIII\TransactionRules\Actions\AppendDescription::act()
*/
public function testActExistingTag()
public function testActExistingTag(): void
{
$ruleAction = new RuleAction;
$ruleAction->action_value = 'APPEND';

View File

@@ -37,7 +37,7 @@ class AppendNotesTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\AppendNotes::__construct()
* @covers \FireflyIII\TransactionRules\Actions\AppendNotes::act()
*/
public function testAct()
public function testAct(): void
{
// give journal some notes.
$journal = TransactionJournal::find(3);
@@ -66,7 +66,7 @@ class AppendNotesTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\AppendNotes::__construct()
* @covers \FireflyIII\TransactionRules\Actions\AppendNotes::act()
*/
public function testActNewNote()
public function testActNewNote(): void
{
// give journal some notes.
$journal = TransactionJournal::find(4);

View File

@@ -37,7 +37,7 @@ class ClearBudgetTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\ClearBudget::__construct()
* @covers \FireflyIII\TransactionRules\Actions\ClearBudget::act()
*/
public function testAct()
public function testAct(): void
{
// associate budget with journal:
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();

View File

@@ -37,7 +37,7 @@ class ClearCategoryTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\ClearCategory::__construct()
* @covers \FireflyIII\TransactionRules\Actions\ClearCategory::act()
*/
public function testAct()
public function testAct(): void
{
// associate budget with journal:
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();

View File

@@ -22,6 +22,7 @@ declare(strict_types=1);
namespace Tests\Unit\TransactionRules\Actions;
use Exception;
use FireflyIII\Models\Note;
use FireflyIII\Models\RuleAction;
use FireflyIII\Models\TransactionJournal;
@@ -37,7 +38,7 @@ class ClearNotesTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\ClearNotes::__construct()
* @covers \FireflyIII\TransactionRules\Actions\ClearNotes::act()
*/
public function testAct()
public function testAct(): void
{
// give journal a note:
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
@@ -54,7 +55,11 @@ class ClearNotesTest extends TestCase
$ruleAction = new RuleAction;
$ruleAction->action_value = null;
$action = new ClearNotes($ruleAction);
$result = $action->act($journal);
try {
$result = $action->act($journal);
} catch (Exception $e) {
$this->assertTrue(false, $e->getMessage());
}
$this->assertTrue($result);
// assert result

View File

@@ -36,7 +36,7 @@ class PrependDescriptionTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\PrependDescription::__construct()
* @covers \FireflyIII\TransactionRules\Actions\PrependDescription::act()
*/
public function testAct()
public function testAct(): void
{
// get journal, give fixed description
$description = 'text' . random_int(1, 1000);

View File

@@ -37,7 +37,7 @@ class PrependNotesTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\PrependNotes::__construct()
* @covers \FireflyIII\TransactionRules\Actions\PrependNotes::act()
*/
public function testAct()
public function testAct(): void
{
// give journal some notes.
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
@@ -66,7 +66,7 @@ class PrependNotesTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\PrependNotes::__construct()
* @covers \FireflyIII\TransactionRules\Actions\PrependNotes::act()
*/
public function testActNewNote()
public function testActNewNote(): void
{
// give journal some notes.
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();

View File

@@ -37,7 +37,7 @@ class RemoveAllTagsTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\RemoveAllTags::__construct()
* @covers \FireflyIII\TransactionRules\Actions\RemoveAllTags::act()
*/
public function testAct()
public function testAct(): void
{
// find journal with at least one tag
$journalIds = DB::table('tag_transaction_journal')->get(['transaction_journal_id'])->pluck('transaction_journal_id')->toArray();

View File

@@ -37,7 +37,7 @@ class RemoveTagTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\RemoveTag::__construct()
* @covers \FireflyIII\TransactionRules\Actions\RemoveTag::act()
*/
public function testAct()
public function testAct(): void
{
// find journal with at least one tag
@@ -64,7 +64,7 @@ class RemoveTagTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\RemoveTag::__construct()
* @covers \FireflyIII\TransactionRules\Actions\RemoveTag::act()
*/
public function testActNoTag()
public function testActNoTag(): void
{
// get journal, link al tags:
/** @var TransactionJournal $journal */

View File

@@ -39,7 +39,7 @@ class SetBudgetTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\SetBudget::__construct()
* @covers \FireflyIII\TransactionRules\Actions\SetBudget::act()
*/
public function testAct()
public function testAct(): void
{
// get journal, remove all budgets
$journal = TransactionJournal::inRandomOrder()->where('transaction_type_id', 1)->whereNull('deleted_at')->first();

View File

@@ -37,7 +37,7 @@ class SetCategoryTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\SetCategory::__construct()
* @covers \FireflyIII\TransactionRules\Actions\SetCategory::act()
*/
public function testAct()
public function testAct(): void
{
// get journal, remove all budgets
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();

View File

@@ -36,7 +36,7 @@ class SetDescriptionTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\SetDescription::__construct()
* @covers \FireflyIII\TransactionRules\Actions\SetDescription::act()
*/
public function testAct()
public function testAct(): void
{
// get journal, give fixed description
$description = 'text' . random_int(1, 1000);

View File

@@ -44,7 +44,7 @@ class SetDestinationAccountTest extends TestCase
*
* @covers \FireflyIII\TransactionRules\Actions\SetDestinationAccount
*/
public function testActDepositExisting()
public function testActDepositExisting(): void
{
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$type = TransactionType::whereType(TransactionType::DEPOSIT)->first();
@@ -86,7 +86,7 @@ class SetDestinationAccountTest extends TestCase
*
* @covers \FireflyIII\TransactionRules\Actions\SetDestinationAccount
*/
public function testActDepositNotExisting()
public function testActDepositNotExisting(): void
{
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$type = TransactionType::whereType(TransactionType::DEPOSIT)->first();
@@ -114,7 +114,7 @@ class SetDestinationAccountTest extends TestCase
*
* @covers \FireflyIII\TransactionRules\Actions\SetDestinationAccount
*/
public function testActWithDrawalNotExisting()
public function testActWithDrawalNotExisting(): void
{
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$type = TransactionType::whereType(TransactionType::WITHDRAWAL)->first();
@@ -146,7 +146,7 @@ class SetDestinationAccountTest extends TestCase
*
* @covers \FireflyIII\TransactionRules\Actions\SetDestinationAccount
*/
public function testActWithdrawalExisting()
public function testActWithdrawalExisting(): void
{
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$type = TransactionType::whereType(TransactionType::WITHDRAWAL)->first();
@@ -189,7 +189,7 @@ class SetDestinationAccountTest extends TestCase
*
* @covers \FireflyIII\TransactionRules\Actions\SetDestinationAccount
*/
public function testSplitJournal()
public function testSplitJournal(): void
{
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$transaction = Transaction::orderBy('count', 'DESC')->groupBy('transaction_journal_id')

View File

@@ -37,7 +37,7 @@ class SetNotesTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\SetNotes::__construct()
* @covers \FireflyIII\TransactionRules\Actions\SetNotes::act()
*/
public function testAct()
public function testAct(): void
{
// give journal a note:
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
@@ -66,7 +66,7 @@ class SetNotesTest extends TestCase
* @covers \FireflyIII\TransactionRules\Actions\SetNotes::__construct()
* @covers \FireflyIII\TransactionRules\Actions\SetNotes::act()
*/
public function testActNoNotes()
public function testActNoNotes(): void
{
// give journal a note:
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();

View File

@@ -42,7 +42,7 @@ class SetSourceAccountTest extends TestCase
*
* @covers \FireflyIII\TransactionRules\Actions\SetSourceAccount
*/
public function testActDepositExistingUpdated()
public function testActDepositExistingUpdated(): void
{
$accountRepos = $this->mock(AccountRepositoryInterface::class);
@@ -86,7 +86,7 @@ class SetSourceAccountTest extends TestCase
*
* @covers \FireflyIII\TransactionRules\Actions\SetSourceAccount
*/
public function testActDepositRevenue()
public function testActDepositRevenue(): void
{
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$type = TransactionType::whereType(TransactionType::DEPOSIT)->first();
@@ -115,7 +115,7 @@ class SetSourceAccountTest extends TestCase
*
* @covers \FireflyIII\TransactionRules\Actions\SetSourceAccount
*/
public function testActWithdrawalExistingUpdated()
public function testActWithdrawalExistingUpdated(): void
{
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$type = TransactionType::whereType(TransactionType::WITHDRAWAL)->first();
@@ -157,7 +157,7 @@ class SetSourceAccountTest extends TestCase
*
* @covers \FireflyIII\TransactionRules\Actions\SetSourceAccount
*/
public function testActWithdrawalNotExisting()
public function testActWithdrawalNotExisting(): void
{
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$type = TransactionType::whereType(TransactionType::WITHDRAWAL)->first();
@@ -184,7 +184,7 @@ class SetSourceAccountTest extends TestCase
*
* @covers \FireflyIII\TransactionRules\Actions\SetSourceAccount
*/
public function testSplitJournal()
public function testSplitJournal(): void
{
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$transaction = Transaction::orderBy('count', 'DESC')->groupBy('transaction_journal_id')

View File

@@ -35,7 +35,7 @@ class AmountExactlyTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\AmountExactly::triggered
*/
public function testTriggeredExact()
public function testTriggeredExact(): void
{
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('setUser');
@@ -51,7 +51,7 @@ class AmountExactlyTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\AmountExactly::triggered
*/
public function testTriggeredNotExact()
public function testTriggeredNotExact(): void
{
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('setUser');
@@ -67,7 +67,7 @@ class AmountExactlyTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\AmountExactly::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = AmountExactly::willMatchEverything($value);
@@ -77,7 +77,7 @@ class AmountExactlyTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\AmountExactly::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = AmountExactly::willMatchEverything($value);

View File

@@ -35,7 +35,7 @@ class AmountLessTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\AmountLess::triggered
*/
public function testTriggeredExact()
public function testTriggeredExact(): void
{
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('setUser');
@@ -52,7 +52,7 @@ class AmountLessTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\AmountLess::triggered
*/
public function testTriggeredLess()
public function testTriggeredLess(): void
{
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('setUser');
@@ -69,7 +69,7 @@ class AmountLessTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\AmountLess::triggered
*/
public function testTriggeredNotLess()
public function testTriggeredNotLess(): void
{
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('setUser');
@@ -86,7 +86,7 @@ class AmountLessTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\AmountLess::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = AmountLess::willMatchEverything($value);
@@ -96,7 +96,7 @@ class AmountLessTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\AmountLess::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = AmountLess::willMatchEverything($value);

View File

@@ -35,7 +35,7 @@ class AmountMoreTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\AmountMore::triggered
*/
public function testTriggeredExact()
public function testTriggeredExact(): void
{
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('setUser');
@@ -52,7 +52,7 @@ class AmountMoreTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\AmountMore::triggered
*/
public function testTriggeredMore()
public function testTriggeredMore(): void
{
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('setUser');
@@ -69,7 +69,7 @@ class AmountMoreTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\AmountMore::triggered
*/
public function testTriggeredNotMore()
public function testTriggeredNotMore(): void
{
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('setUser');
@@ -86,7 +86,7 @@ class AmountMoreTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\AmountMore::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = '1';
$result = AmountMore::willMatchEverything($value);
@@ -96,7 +96,7 @@ class AmountMoreTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\AmountMore::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = AmountMore::willMatchEverything($value);
@@ -106,7 +106,7 @@ class AmountMoreTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\AmountMore::willMatchEverything
*/
public function testWillMatchEverythingZero()
public function testWillMatchEverythingZero(): void
{
$value = '0';
$result = AmountMore::willMatchEverything($value);

View File

@@ -24,6 +24,7 @@ namespace Tests\Unit\TransactionRules\Triggers;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\TransactionRules\Triggers\BudgetIs;
use Illuminate\Support\Collection;
use Tests\TestCase;
/**
@@ -34,7 +35,7 @@ class BudgetIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\BudgetIs::triggered
*/
public function testTriggeredJournal()
public function testTriggeredJournal(): void
{
do {
$journal = TransactionJournal::inRandomOrder()->where('transaction_type_id', 1)->whereNull('deleted_at')->first();
@@ -54,7 +55,7 @@ class BudgetIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\BudgetIs::triggered
*/
public function testTriggeredNotJournal()
public function testTriggeredNotJournal(): void
{
do {
$journal = TransactionJournal::inRandomOrder()->where('transaction_type_id', 1)->whereNull('deleted_at')->first();
@@ -75,13 +76,14 @@ class BudgetIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\BudgetIs::triggered
*/
public function testTriggeredTransaction()
public function testTriggeredTransaction(): void
{
do {
$journal = TransactionJournal::inRandomOrder()->where('transaction_type_id', 1)->whereNull('deleted_at')->first();
$count = $journal->transactions()->count();
} while ($count !== 2);
/** @var Collection $transactions */
$transactions = $journal->transactions()->get();
$budget = $journal->user->budgets()->first();
@@ -101,7 +103,7 @@ class BudgetIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\BudgetIs::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = BudgetIs::willMatchEverything($value);
@@ -111,7 +113,7 @@ class BudgetIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\BudgetIs::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = BudgetIs::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class CategoryIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\CategoryIs::triggered
*/
public function testTriggeredJournal()
public function testTriggeredJournal(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$category = $journal->user->categories()->first();
@@ -50,7 +50,7 @@ class CategoryIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\CategoryIs::triggered
*/
public function testTriggeredNotJournal()
public function testTriggeredNotJournal(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$category = $journal->user->categories()->first();
@@ -67,7 +67,7 @@ class CategoryIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\CategoryIs::triggered
*/
public function testTriggeredTransaction()
public function testTriggeredTransaction(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$transaction = $journal->transactions()->first();
@@ -87,7 +87,7 @@ class CategoryIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\CategoryIs::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = CategoryIs::willMatchEverything($value);
@@ -97,7 +97,7 @@ class CategoryIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\CategoryIs::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = CategoryIs::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class DescriptionContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionContains::triggered
*/
public function testTriggeredCase()
public function testTriggeredCase(): void
{
$journal = new TransactionJournal;
$journal->description = 'Lorem IPSUM bla bla ';
@@ -46,7 +46,7 @@ class DescriptionContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionContains::triggered
*/
public function testTriggeredDefault()
public function testTriggeredDefault(): void
{
$journal = new TransactionJournal;
$journal->description = 'Should contain test string';
@@ -58,7 +58,7 @@ class DescriptionContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionContains::triggered
*/
public function testTriggeredEnd()
public function testTriggeredEnd(): void
{
$journal = new TransactionJournal;
$journal->description = 'Something is going to happen';
@@ -70,7 +70,7 @@ class DescriptionContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionContains::triggered
*/
public function testTriggeredNot()
public function testTriggeredNot(): void
{
$journal = new TransactionJournal;
$journal->description = 'Lorem IPSUM bla bla ';
@@ -82,7 +82,7 @@ class DescriptionContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionContains::triggered
*/
public function testTriggeredStart()
public function testTriggeredStart(): void
{
$journal = new TransactionJournal;
$journal->description = 'Something is going to happen';
@@ -94,7 +94,7 @@ class DescriptionContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionContains::willMatchEverything
*/
public function testWillMatchEverythingEmpty()
public function testWillMatchEverythingEmpty(): void
{
$value = '';
$result = DescriptionContains::willMatchEverything($value);
@@ -104,7 +104,7 @@ class DescriptionContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionContains::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = DescriptionContains::willMatchEverything($value);
@@ -114,7 +114,7 @@ class DescriptionContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionContains::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = DescriptionContains::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class DescriptionEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionEnds::triggered
*/
public function testTriggeredCase()
public function testTriggeredCase(): void
{
$journal = new TransactionJournal;
$journal->description = 'Lorem IPSUMbla';
@@ -46,7 +46,7 @@ class DescriptionEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionEnds::triggered
*/
public function testTriggeredClose()
public function testTriggeredClose(): void
{
$journal = new TransactionJournal;
$journal->description = 'Something is going to happen';
@@ -58,7 +58,7 @@ class DescriptionEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionEnds::triggered
*/
public function testTriggeredDefault()
public function testTriggeredDefault(): void
{
$journal = new TransactionJournal;
$journal->description = 'Should contain test string';
@@ -70,7 +70,7 @@ class DescriptionEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionEnds::triggered
*/
public function testTriggeredLongSearch()
public function testTriggeredLongSearch(): void
{
$journal = new TransactionJournal;
$journal->description = 'Something';
@@ -82,7 +82,7 @@ class DescriptionEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionEnds::triggered
*/
public function testTriggeredLonger()
public function testTriggeredLonger(): void
{
$journal = new TransactionJournal;
$journal->description = 'Something is going to happen';
@@ -94,7 +94,7 @@ class DescriptionEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionEnds::triggered
*/
public function testTriggeredNot()
public function testTriggeredNot(): void
{
$journal = new TransactionJournal;
$journal->description = 'Lorem IPSUM blabla';
@@ -106,7 +106,7 @@ class DescriptionEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionEnds::willMatchEverything
*/
public function testWillMatchEverythingEmpty()
public function testWillMatchEverythingEmpty(): void
{
$value = '';
$result = DescriptionEnds::willMatchEverything($value);
@@ -116,7 +116,7 @@ class DescriptionEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionEnds::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = DescriptionEnds::willMatchEverything($value);
@@ -126,7 +126,7 @@ class DescriptionEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionEnds::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = DescriptionEnds::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class DescriptionIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionIs::triggered
*/
public function testTriggeredCase()
public function testTriggeredCase(): void
{
$journal = new TransactionJournal;
$journal->description = 'Lorem IPSUMbla';
@@ -46,7 +46,7 @@ class DescriptionIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionIs::triggered
*/
public function testTriggeredClose()
public function testTriggeredClose(): void
{
$journal = new TransactionJournal;
$journal->description = 'Something is going to happen';
@@ -58,7 +58,7 @@ class DescriptionIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionIs::triggered
*/
public function testTriggeredDefault()
public function testTriggeredDefault(): void
{
$journal = new TransactionJournal;
$journal->description = 'Should be test string';
@@ -70,7 +70,7 @@ class DescriptionIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionIs::triggered
*/
public function testTriggeredNot()
public function testTriggeredNot(): void
{
$journal = new TransactionJournal;
$journal->description = 'Lorem IPSUM blabla';
@@ -82,7 +82,7 @@ class DescriptionIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionIs::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = DescriptionIs::willMatchEverything($value);
@@ -92,7 +92,7 @@ class DescriptionIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionIs::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = DescriptionIs::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class DescriptionStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionStarts::triggered
*/
public function testTriggeredCase()
public function testTriggeredCase(): void
{
$journal = new TransactionJournal;
$journal->description = 'Lorem IPSUMbla';
@@ -46,7 +46,7 @@ class DescriptionStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionStarts::triggered
*/
public function testTriggeredClose()
public function testTriggeredClose(): void
{
$journal = new TransactionJournal;
$journal->description = 'Something is going to happen';
@@ -58,7 +58,7 @@ class DescriptionStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionStarts::triggered
*/
public function testTriggeredDefault()
public function testTriggeredDefault(): void
{
$journal = new TransactionJournal;
$journal->description = 'Should contain test string';
@@ -70,7 +70,7 @@ class DescriptionStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionStarts::triggered
*/
public function testTriggeredLongSearch()
public function testTriggeredLongSearch(): void
{
$journal = new TransactionJournal;
$journal->description = 'Something';
@@ -82,7 +82,7 @@ class DescriptionStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionStarts::triggered
*/
public function testTriggeredNot()
public function testTriggeredNot(): void
{
$journal = new TransactionJournal;
$journal->description = 'Lorem IPSUM blabla';
@@ -94,7 +94,7 @@ class DescriptionStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionStarts::willMatchEverything
*/
public function testWillMatchEverythingEmpty()
public function testWillMatchEverythingEmpty(): void
{
$value = '';
$result = DescriptionStarts::willMatchEverything($value);
@@ -104,7 +104,7 @@ class DescriptionStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionStarts::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = DescriptionStarts::willMatchEverything($value);
@@ -114,7 +114,7 @@ class DescriptionStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\DescriptionStarts::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = DescriptionStarts::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class FromAccountContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountContains::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$count = 0;
while ($count === 0) {
@@ -52,7 +52,7 @@ class FromAccountContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountContains::triggered
*/
public function testTriggeredNot()
public function testTriggeredNot(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
@@ -64,7 +64,7 @@ class FromAccountContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountContains::willMatchEverything
*/
public function testWillMatchEverythingEmpty()
public function testWillMatchEverythingEmpty(): void
{
$value = '';
$result = FromAccountContains::willMatchEverything($value);
@@ -74,7 +74,7 @@ class FromAccountContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountContains::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = FromAccountContains::willMatchEverything($value);
@@ -84,7 +84,7 @@ class FromAccountContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountContains::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = FromAccountContains::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class FromAccountEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountEnds::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$count = 0;
while ($count === 0) {
@@ -52,7 +52,7 @@ class FromAccountEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountEnds::triggered
*/
public function testTriggeredLonger()
public function testTriggeredLonger(): void
{
$count = 0;
while ($count === 0) {
@@ -70,7 +70,7 @@ class FromAccountEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountEnds::triggered
*/
public function testTriggeredNot()
public function testTriggeredNot(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
@@ -82,7 +82,7 @@ class FromAccountEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountEnds::willMatchEverything
*/
public function testWillMatchEverythingEmpty()
public function testWillMatchEverythingEmpty(): void
{
$value = '';
$result = FromAccountEnds::willMatchEverything($value);
@@ -92,7 +92,7 @@ class FromAccountEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountEnds::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = FromAccountEnds::willMatchEverything($value);
@@ -102,7 +102,7 @@ class FromAccountEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountEnds::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = FromAccountEnds::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class FromAccountIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountIs::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$count = 0;
while ($count === 0) {
@@ -52,7 +52,7 @@ class FromAccountIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountIs::triggered
*/
public function testTriggeredNot()
public function testTriggeredNot(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
@@ -64,7 +64,7 @@ class FromAccountIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountIs::willMatchEverything
*/
public function testWillMatchEverythingEmpty()
public function testWillMatchEverythingEmpty(): void
{
$value = '';
$result = FromAccountIs::willMatchEverything($value);
@@ -74,7 +74,7 @@ class FromAccountIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountIs::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = FromAccountIs::willMatchEverything($value);
@@ -84,7 +84,7 @@ class FromAccountIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountIs::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = FromAccountIs::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class FromAccountStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountStarts::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$transaction = null;
do {
@@ -51,7 +51,7 @@ class FromAccountStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountStarts::triggered
*/
public function testTriggeredLonger()
public function testTriggeredLonger(): void
{
$transaction = null;
do {
@@ -69,7 +69,7 @@ class FromAccountStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountStarts::triggered
*/
public function testTriggeredNot()
public function testTriggeredNot(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
@@ -81,7 +81,7 @@ class FromAccountStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountStarts::willMatchEverything
*/
public function testWillMatchEverythingEmpty()
public function testWillMatchEverythingEmpty(): void
{
$value = '';
$result = FromAccountStarts::willMatchEverything($value);
@@ -91,7 +91,7 @@ class FromAccountStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountStarts::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = FromAccountStarts::willMatchEverything($value);
@@ -101,7 +101,7 @@ class FromAccountStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountStarts::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = FromAccountStarts::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class HasAnyBudgetTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasAnyBudget::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$budget = $journal->user->budgets()->first();
@@ -50,7 +50,7 @@ class HasAnyBudgetTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasAnyBudget::triggered
*/
public function testTriggeredNot()
public function testTriggeredNot(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->budgets()->detach();
@@ -63,7 +63,7 @@ class HasAnyBudgetTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasAnyBudget::triggered
*/
public function testTriggeredTransactions()
public function testTriggeredTransactions(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$budget = $journal->user->budgets()->first();
@@ -86,7 +86,7 @@ class HasAnyBudgetTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasAnyBudget::willMatchEverything
*/
public function testWillMatchEverything()
public function testWillMatchEverything(): void
{
$value = '';
$result = HasAnyBudget::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class HasAnyTagTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasAnyTag::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$tag = $journal->user->tags()->first();
@@ -50,7 +50,7 @@ class HasAnyTagTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasAnyTag::triggered
*/
public function testTriggeredNot()
public function testTriggeredNot(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->tags()->detach();
@@ -63,7 +63,7 @@ class HasAnyTagTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasAnyTag::willMatchEverything
*/
public function testWillMatchEverything()
public function testWillMatchEverything(): void
{
$value = '';
$result = HasAnyTag::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class HasAttachmentTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasAttachment::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
do {
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
@@ -53,7 +53,7 @@ class HasAttachmentTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasAttachment::triggered
*/
public function testTriggeredFalse()
public function testTriggeredFalse(): void
{
do {
// this is kind of cheating but OK.
@@ -71,7 +71,7 @@ class HasAttachmentTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasAttachment::willMatchEverything
*/
public function testWillMatchEverything()
public function testWillMatchEverything(): void
{
$value = '5';
$result = HasAttachment::willMatchEverything($value);
@@ -81,7 +81,7 @@ class HasAttachmentTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasAttachment::willMatchEverything
*/
public function testWillMatchEverythingTrue()
public function testWillMatchEverythingTrue(): void
{
$value = -1;
$result = HasAttachment::willMatchEverything($value);

View File

@@ -35,7 +35,7 @@ class HasNoBudgetTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasNoBudget::triggered
*/
public function testTriggeredBudget()
public function testTriggeredBudget(): void
{
$journal = TransactionJournal::inRandomOrder()->where('transaction_type_id', 1)->whereNull('deleted_at')->first();
$budget = $journal->user->budgets()->first();
@@ -51,7 +51,7 @@ class HasNoBudgetTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasNoBudget::triggered
*/
public function testTriggeredNoBudget()
public function testTriggeredNoBudget(): void
{
/** @var TransactionJournal $journal */
$journal = TransactionJournal::inRandomOrder()->where('transaction_type_id', 1)->whereNull('deleted_at')->first();
@@ -70,7 +70,7 @@ class HasNoBudgetTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasNoBudget::triggered
*/
public function testTriggeredTransaction()
public function testTriggeredTransaction(): void
{
/** @var TransactionJournal $journal */
$journal = TransactionJournal::inRandomOrder()->where('transaction_type_id', 1)->whereNull('deleted_at')->first();
@@ -93,7 +93,7 @@ class HasNoBudgetTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasNoBudget::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = HasNoBudget::willMatchEverything($value);

View File

@@ -35,7 +35,7 @@ class HasNoCategoryTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasNoCategory::triggered
*/
public function testTriggeredCategory()
public function testTriggeredCategory(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$category = $journal->user->categories()->first();
@@ -51,7 +51,7 @@ class HasNoCategoryTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasNoCategory::triggered
*/
public function testTriggeredNoCategory()
public function testTriggeredNoCategory(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->categories()->detach();
@@ -73,7 +73,7 @@ class HasNoCategoryTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasNoCategory::triggered
*/
public function testTriggeredTransaction()
public function testTriggeredTransaction(): void
{
$count = 0;
while ($count === 0) {
@@ -96,7 +96,7 @@ class HasNoCategoryTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasNoCategory::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = HasNoCategory::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class HasNoTagTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasNoTag::triggered
*/
public function testTriggeredNoTag()
public function testTriggeredNoTag(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->tags()->detach();
@@ -48,7 +48,7 @@ class HasNoTagTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasNoTag::triggered
*/
public function testTriggeredTag()
public function testTriggeredTag(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$tag = $journal->user->tags()->first();
@@ -64,7 +64,7 @@ class HasNoTagTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\HasNoTag::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = HasNoTag::willMatchEverything($value);

View File

@@ -35,7 +35,7 @@ class NotesAnyTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesAny::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -51,7 +51,7 @@ class NotesAnyTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesAny::triggered
*/
public function testTriggeredEmpty()
public function testTriggeredEmpty(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -67,7 +67,7 @@ class NotesAnyTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesAny::triggered
*/
public function testTriggeredNone()
public function testTriggeredNone(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -79,7 +79,7 @@ class NotesAnyTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesAny::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = NotesAny::willMatchEverything($value);

View File

@@ -35,7 +35,7 @@ class NotesAreTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesAre::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -51,7 +51,7 @@ class NotesAreTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesAre::triggered
*/
public function testTriggeredDifferent()
public function testTriggeredDifferent(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -67,7 +67,7 @@ class NotesAreTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesAre::triggered
*/
public function testTriggeredEmpty()
public function testTriggeredEmpty(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -83,7 +83,7 @@ class NotesAreTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesAre::triggered
*/
public function testTriggeredNone()
public function testTriggeredNone(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -95,7 +95,7 @@ class NotesAreTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesAre::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = NotesAre::willMatchEverything($value);
@@ -105,7 +105,7 @@ class NotesAreTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesAre::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = NotesAre::willMatchEverything($value);

View File

@@ -35,7 +35,7 @@ class NotesContainTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesContain::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -51,7 +51,7 @@ class NotesContainTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesContain::triggered
*/
public function testTriggeredDifferent()
public function testTriggeredDifferent(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -67,7 +67,7 @@ class NotesContainTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesContain::triggered
*/
public function testTriggeredEmpty()
public function testTriggeredEmpty(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -83,7 +83,7 @@ class NotesContainTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesContain::triggered
*/
public function testTriggeredNone()
public function testTriggeredNone(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -95,7 +95,7 @@ class NotesContainTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesContain::triggered
*/
public function testTriggeredPartial()
public function testTriggeredPartial(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -111,7 +111,7 @@ class NotesContainTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesContain::willMatchEverything
*/
public function testWillMatchEverythingEmpty()
public function testWillMatchEverythingEmpty(): void
{
$value = '';
$result = NotesContain::willMatchEverything($value);
@@ -121,7 +121,7 @@ class NotesContainTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesContain::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = NotesContain::willMatchEverything($value);
@@ -131,7 +131,7 @@ class NotesContainTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesContain::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = NotesContain::willMatchEverything($value);

View File

@@ -35,7 +35,7 @@ class NotesEmptyTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesEmpty::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -47,7 +47,7 @@ class NotesEmptyTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesEmpty::triggered
*/
public function testTriggeredEmpty()
public function testTriggeredEmpty(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -63,7 +63,7 @@ class NotesEmptyTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesEmpty::triggered
*/
public function testTriggeredPartial()
public function testTriggeredPartial(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -79,7 +79,7 @@ class NotesEmptyTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesEmpty::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = NotesEmpty::willMatchEverything($value);

View File

@@ -35,7 +35,7 @@ class NotesEndTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesEnd::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -51,7 +51,7 @@ class NotesEndTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesEnd::triggered
*/
public function testTriggeredLonger()
public function testTriggeredLonger(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -67,7 +67,7 @@ class NotesEndTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesEnd::triggered
*/
public function testTriggeredNoMatch()
public function testTriggeredNoMatch(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -83,7 +83,7 @@ class NotesEndTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesEnd::willMatchEverything
*/
public function testWillMatchEverythingEmpty()
public function testWillMatchEverythingEmpty(): void
{
$value = '';
$result = NotesEnd::willMatchEverything($value);
@@ -93,7 +93,7 @@ class NotesEndTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesEnd::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = NotesEnd::willMatchEverything($value);
@@ -103,7 +103,7 @@ class NotesEndTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesEnd::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = NotesEnd::willMatchEverything($value);

View File

@@ -35,7 +35,7 @@ class NotesStartTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesStart::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -51,7 +51,7 @@ class NotesStartTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesStart::triggered
*/
public function testTriggeredLonger()
public function testTriggeredLonger(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -67,7 +67,7 @@ class NotesStartTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesStart::triggered
*/
public function testTriggeredNoMatch()
public function testTriggeredNoMatch(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->notes()->delete();
@@ -83,7 +83,7 @@ class NotesStartTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesStart::willMatchEverything
*/
public function testWillMatchEverythingEmpty()
public function testWillMatchEverythingEmpty(): void
{
$value = '';
$result = NotesStart::willMatchEverything($value);
@@ -93,7 +93,7 @@ class NotesStartTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesStart::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = NotesStart::willMatchEverything($value);
@@ -103,7 +103,7 @@ class NotesStartTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\NotesStart::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = NotesStart::willMatchEverything($value);

View File

@@ -24,6 +24,7 @@ namespace Tests\Unit\TransactionRules\Triggers;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\TransactionRules\Triggers\TagIs;
use Illuminate\Support\Collection;
use Tests\TestCase;
/**
@@ -34,7 +35,7 @@ class TagIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\TagIs::triggered
*/
public function testNotTriggered()
public function testNotTriggered(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->tags()->detach();
@@ -48,10 +49,11 @@ class TagIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\TagIs::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal->tags()->detach();
/** @var Collection $tags */
$tags = $journal->user->tags()->take(3)->get();
$search = '';
foreach ($tags as $index => $tag) {
@@ -70,7 +72,7 @@ class TagIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\TagIs::willMatchEverything
*/
public function testWillMatchEverythingEmpty()
public function testWillMatchEverythingEmpty(): void
{
$value = '';
$result = TagIs::willMatchEverything($value);
@@ -80,7 +82,7 @@ class TagIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\TagIs::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = TagIs::willMatchEverything($value);
@@ -90,7 +92,7 @@ class TagIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\TagIs::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = TagIs::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class ToAccountContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountContains::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
@@ -47,7 +47,7 @@ class ToAccountContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountContains::triggered
*/
public function testTriggeredNot()
public function testTriggeredNot(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$trigger = ToAccountContains::makeFromStrings('some name' . random_int(1, 234), false);
@@ -58,7 +58,7 @@ class ToAccountContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountContains::willMatchEverything
*/
public function testWillMatchEverythingEmpty()
public function testWillMatchEverythingEmpty(): void
{
$value = '';
$result = ToAccountContains::willMatchEverything($value);
@@ -68,7 +68,7 @@ class ToAccountContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountContains::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = ToAccountContains::willMatchEverything($value);
@@ -78,7 +78,7 @@ class ToAccountContainsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountContains::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = ToAccountContains::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class ToAccountEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountEnds::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$count = 0;
while ($count === 0) {
@@ -52,7 +52,7 @@ class ToAccountEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountEnds::triggered
*/
public function testTriggeredLonger()
public function testTriggeredLonger(): void
{
$count = 0;
while ($count === 0) {
@@ -70,7 +70,7 @@ class ToAccountEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountEnds::triggered
*/
public function testTriggeredNot()
public function testTriggeredNot(): void
{
$count = 0;
while ($count === 0) {
@@ -86,7 +86,7 @@ class ToAccountEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountEnds::willMatchEverything
*/
public function testWillMatchEverythingEmpty()
public function testWillMatchEverythingEmpty(): void
{
$value = '';
$result = ToAccountEnds::willMatchEverything($value);
@@ -96,7 +96,7 @@ class ToAccountEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountEnds::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = ToAccountEnds::willMatchEverything($value);
@@ -106,7 +106,7 @@ class ToAccountEndsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountEnds::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = ToAccountEnds::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class ToAccountIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountIs::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
@@ -48,7 +48,7 @@ class ToAccountIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountIs::triggered
*/
public function testTriggeredNot()
public function testTriggeredNot(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
@@ -60,7 +60,7 @@ class ToAccountIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountIs::willMatchEverything
*/
public function testWillMatchEverythingEmpty()
public function testWillMatchEverythingEmpty(): void
{
$value = '';
$result = ToAccountIs::willMatchEverything($value);
@@ -70,7 +70,7 @@ class ToAccountIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountIs::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = ToAccountIs::willMatchEverything($value);
@@ -80,7 +80,7 @@ class ToAccountIsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountIs::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = ToAccountIs::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class ToAccountStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountStarts::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$count = 0;
while ($count === 0) {
@@ -52,7 +52,7 @@ class ToAccountStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountStarts::triggered
*/
public function testTriggeredLonger()
public function testTriggeredLonger(): void
{
$count = 0;
while ($count === 0) {
@@ -70,7 +70,7 @@ class ToAccountStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountStarts::triggered
*/
public function testTriggeredNot()
public function testTriggeredNot(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
@@ -82,7 +82,7 @@ class ToAccountStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountStarts::willMatchEverything
*/
public function testWillMatchEverythingEmpty()
public function testWillMatchEverythingEmpty(): void
{
$value = '';
$result = ToAccountStarts::willMatchEverything($value);
@@ -92,7 +92,7 @@ class ToAccountStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountStarts::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = ToAccountStarts::willMatchEverything($value);
@@ -102,7 +102,7 @@ class ToAccountStartsTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\ToAccountStarts::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = ToAccountStarts::willMatchEverything($value);

View File

@@ -34,7 +34,7 @@ class TransactionTypeTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\TransactionType::triggered
*/
public function testTriggered()
public function testTriggered(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$type = $journal->transactionType->type;
@@ -46,7 +46,7 @@ class TransactionTypeTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\TransactionType::triggered
*/
public function testTriggeredFalse()
public function testTriggeredFalse(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$trigger = TransactionType::makeFromStrings('NonExisting', false);
@@ -57,7 +57,7 @@ class TransactionTypeTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\TransactionType::willMatchEverything
*/
public function testWillMatchEverythingNotNull()
public function testWillMatchEverythingNotNull(): void
{
$value = 'x';
$result = TransactionType::willMatchEverything($value);
@@ -67,7 +67,7 @@ class TransactionTypeTest extends TestCase
/**
* @covers \FireflyIII\TransactionRules\Triggers\TransactionType::willMatchEverything
*/
public function testWillMatchEverythingNull()
public function testWillMatchEverythingNull(): void
{
$value = null;
$result = TransactionType::willMatchEverything($value);

View File

@@ -45,7 +45,7 @@ class AccountTransformerTest extends TestCase
*
* @covers \FireflyIII\Transformers\AccountTransformer::transform
*/
public function testBasic()
public function testBasic(): void
{
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$accountRepos->shouldReceive('setUser');
@@ -83,7 +83,7 @@ class AccountTransformerTest extends TestCase
*
* @covers \FireflyIII\Transformers\AccountTransformer::transform
*/
public function testBasicDate()
public function testBasicDate(): void
{
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$accountRepos->shouldReceive('setUser');
@@ -121,7 +121,7 @@ class AccountTransformerTest extends TestCase
*
* @covers \FireflyIII\Transformers\AccountTransformer::transform
*/
public function testCCDataAsset()
public function testCCDataAsset(): void
{
// make new account:
$account = Account::create(
@@ -212,7 +212,7 @@ class AccountTransformerTest extends TestCase
*
* @covers \FireflyIII\Transformers\AccountTransformer::transform
*/
public function testIgnoreCCExpense()
public function testIgnoreCCExpense(): void
{
// make new account:
@@ -297,7 +297,7 @@ class AccountTransformerTest extends TestCase
*
* @covers \FireflyIII\Transformers\AccountTransformer::transform
*/
public function testOpeningBalance()
public function testOpeningBalance(): void
{
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$accountRepos->shouldReceive('setUser');
@@ -355,7 +355,7 @@ class AccountTransformerTest extends TestCase
*
* @covers \FireflyIII\Transformers\AccountTransformer::transform
*/
public function testWithCurrency()
public function testWithCurrency(): void
{
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$accountRepos->shouldReceive('setUser');
@@ -401,7 +401,7 @@ class AccountTransformerTest extends TestCase
*
* @covers \FireflyIII\Transformers\AccountTransformer::transform
*/
public function testWithNotes()
public function testWithNotes(): void
{
// make new account:
$account = Account::create(

View File

@@ -39,7 +39,7 @@ class AttachmentTransformerTest extends TestCase
*
* @covers \FireflyIII\Transformers\AttachmentTransformer::transform
*/
public function testBasic()
public function testBasic(): void
{
$md5 = md5('hello' . random_int(1, 10000));
$attachment = Attachment::create(

View File

@@ -44,7 +44,7 @@ class BillTransformerTest extends TestCase
* @covers \FireflyIII\Transformers\BillTransformer::paidData
* @covers \FireflyIII\Transformers\BillTransformer::payDates
*/
public function testBasic()
public function testBasic(): void
{
$bill = Bill::create(
@@ -73,7 +73,7 @@ class BillTransformerTest extends TestCase
*
* @covers \FireflyIII\Transformers\BillTransformer::transform
*/
public function testNote()
public function testNote(): void
{
$bill = Bill::create(
@@ -115,7 +115,7 @@ class BillTransformerTest extends TestCase
* @covers \FireflyIII\Transformers\BillTransformer::lastPaidDate
* @covers \FireflyIII\Transformers\BillTransformer::nextDateMatch
*/
public function testWithDates()
public function testWithDates(): void
{
// mock stuff
$repository = $this->mock(BillRepositoryInterface::class);

View File

@@ -39,7 +39,7 @@ class BudgetTransformerTest extends TestCase
*
* @covers \FireflyIII\Transformers\BudgetTransformer::transform
*/
public function testBasic()
public function testBasic(): void
{
$budget = Budget::create(

Some files were not shown because too many files have changed in this diff Show More