mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix tests.
This commit is contained in:
parent
0502f2a4a5
commit
db149ca6e1
@ -139,7 +139,7 @@ class TransactionController extends Controller
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function show(Request $request, Transaction $transaction, string $include)
|
||||
public function show(Request $request, Transaction $transaction, string $include = null)
|
||||
{
|
||||
$manager = new Manager();
|
||||
$baseUrl = $request->getSchemeAndHttpHost() . '/api/v1';
|
||||
|
@ -109,7 +109,10 @@ class TransactionFactory
|
||||
|
||||
Log::debug(sprintf('Source type is "%s", destination type is "%s"', $sourceAccount->accountType->type, $destinationAccount->accountType->type));
|
||||
// throw big fat error when source type === dest type
|
||||
if ($sourceAccount->accountType->type === $destinationAccount->accountType->type && $journal->transactionType->type !== TransactionType::TRANSFER) {
|
||||
if ($sourceAccount->accountType->type === $destinationAccount->accountType->type
|
||||
&& ($journal->transactionType->type !== TransactionType::TRANSFER
|
||||
&& $journal->transactionType->type !== TransactionType::RECONCILIATION)
|
||||
) {
|
||||
throw new FireflyException(sprintf('Source and destination account cannot be both of the type "%s"', $destinationAccount->accountType->type));
|
||||
}
|
||||
if ($sourceAccount->accountType->type !== AccountType::ASSET && $destinationAccount->accountType->type !== AccountType::ASSET) {
|
||||
|
@ -27,6 +27,7 @@ use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Repositories\Account\AccountTaskerInterface;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
use Steam;
|
||||
@ -57,9 +58,9 @@ class ReportController extends Controller
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function netWorth(Collection $accounts, Carbon $start, Carbon $end)
|
||||
public function netWorth(Collection $accounts, Carbon $start, Carbon $end): JsonResponse
|
||||
{
|
||||
// chart properties for cache:
|
||||
$cache = new CacheProperties;
|
||||
|
@ -30,6 +30,7 @@ use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
use Illuminate\Http\Request;
|
||||
use Log;
|
||||
use View;
|
||||
|
||||
/**
|
||||
@ -70,6 +71,8 @@ class ConvertController extends Controller
|
||||
{
|
||||
// @codeCoverageIgnoreStart
|
||||
if ($this->isOpeningBalance($journal)) {
|
||||
Log::debug('This is an opening balance.');
|
||||
|
||||
return $this->redirectToAccount($journal);
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
@ -80,6 +83,7 @@ class ConvertController extends Controller
|
||||
|
||||
// cannot convert to its own type.
|
||||
if ($sourceType->type === $destinationType->type) {
|
||||
Log::debug('This is already a transaction of the expected type..');
|
||||
session()->flash('info', trans('firefly.convert_is_already_type_' . $destinationType->type));
|
||||
|
||||
return redirect(route('transactions.show', [$journal->id]));
|
||||
@ -87,6 +91,7 @@ class ConvertController extends Controller
|
||||
|
||||
// cannot convert split.
|
||||
if ($journal->transactions()->count() > 2) {
|
||||
Log::info('This journal has more than two transactions.');
|
||||
session()->flash('error', trans('firefly.cannot_convert_split_journal'));
|
||||
|
||||
return redirect(route('transactions.show', [$journal->id]));
|
||||
@ -118,6 +123,7 @@ class ConvertController extends Controller
|
||||
{
|
||||
// @codeCoverageIgnoreStart
|
||||
if ($this->isOpeningBalance($journal)) {
|
||||
Log::debug('Journal is opening balance, return to account.');
|
||||
return $this->redirectToAccount($journal);
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
@ -125,12 +131,14 @@ class ConvertController extends Controller
|
||||
$data = $request->all();
|
||||
|
||||
if ($journal->transactionType->type === $destinationType->type) {
|
||||
Log::info('Journal is already of the desired type.');
|
||||
session()->flash('error', trans('firefly.convert_is_already_type_' . $destinationType->type));
|
||||
|
||||
return redirect(route('transactions.show', [$journal->id]));
|
||||
}
|
||||
|
||||
if ($journal->transactions()->count() > 2) {
|
||||
Log::info('Journal has more than two transactions.');
|
||||
session()->flash('error', trans('firefly.cannot_convert_split_journal'));
|
||||
|
||||
return redirect(route('transactions.show', [$journal->id]));
|
||||
|
@ -60,6 +60,7 @@ class RecurrenceRepetition extends Model
|
||||
'repetition_type' => 'string',
|
||||
'repetition_moment' => 'string',
|
||||
'repetition_skip' => 'int',
|
||||
'weekend' => 'int',
|
||||
];
|
||||
protected $fillable = ['recurrence_id', 'weekend', 'repetition_type', 'repetition_moment', 'repetition_skip'];
|
||||
/** @var string */
|
||||
|
@ -74,6 +74,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
* @property int $attachmentCount
|
||||
* @property int $transaction_currency_id
|
||||
* @property int $foreign_currency_id
|
||||
* @property string $amount
|
||||
* @property string $foreign_amount
|
||||
* @property TransactionJournal $transactionJournal
|
||||
*/
|
||||
class Transaction extends Model
|
||||
{
|
||||
|
@ -44,6 +44,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
* @property int $bill_id
|
||||
* @property Collection $categories
|
||||
* @property bool $completed
|
||||
* @property string $description
|
||||
*/
|
||||
class TransactionJournal extends Model
|
||||
{
|
||||
|
@ -545,7 +545,7 @@ class RecurringRepository implements RecurringRepositoryInterface
|
||||
*/
|
||||
protected function filterWeekends(RecurrenceRepetition $repetition, array $dates): array
|
||||
{
|
||||
if ($repetition->weekend === RecurrenceRepetition::WEEKEND_DO_NOTHING) {
|
||||
if ((int)$repetition->weekend === RecurrenceRepetition::WEEKEND_DO_NOTHING) {
|
||||
Log::debug('Repetition will not be filtered on weekend days.');
|
||||
|
||||
return $dates;
|
||||
|
@ -71,7 +71,7 @@ class CurrencyMapper
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
if (null === $data['code']) {
|
||||
if (!isset($data['code']) || $data['code'] === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -282,7 +282,7 @@ class ImportableConverter
|
||||
'piggy_bank_id' => null,
|
||||
'piggy_bank_name' => null,
|
||||
'bill_id' => $billId,
|
||||
'bill_name' => null === $billId ? $importable->billName : null,
|
||||
'bill_name' => $importable->billName,
|
||||
|
||||
// transaction data:
|
||||
'transactions' => [
|
||||
|
@ -45,8 +45,7 @@ class AboutControllerTest extends TestCase
|
||||
/**
|
||||
* Test the about endpoint
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AboutController::__construct
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AboutController::about
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AboutController
|
||||
*/
|
||||
public function testAbout(): void
|
||||
{
|
||||
@ -65,7 +64,7 @@ class AboutControllerTest extends TestCase
|
||||
/**
|
||||
* Test user end point
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AboutController::user
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AboutController
|
||||
*/
|
||||
public function testUser(): void
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ class AccountControllerTest extends TestCase
|
||||
/**
|
||||
* Destroy account over API.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController::delete
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController
|
||||
*/
|
||||
public function testDelete(): void
|
||||
{
|
||||
@ -72,9 +72,9 @@ class AccountControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController::__construct
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController::index
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController::mapTypes
|
||||
* Test the list of accounts.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController
|
||||
*/
|
||||
public function testIndex(): void
|
||||
{
|
||||
@ -110,10 +110,8 @@ class AccountControllerTest extends TestCase
|
||||
/**
|
||||
* Opening balance without date.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController::store
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::authorize
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::rules
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::getAll
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest
|
||||
*/
|
||||
public function testInvalidBalance(): void
|
||||
{
|
||||
@ -152,10 +150,8 @@ class AccountControllerTest extends TestCase
|
||||
/**
|
||||
* CC type present when account is a credit card.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController::store
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::authorize
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::rules
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::getAll
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest
|
||||
*/
|
||||
public function testNoCreditCardData(): void
|
||||
{
|
||||
@ -194,10 +190,8 @@ class AccountControllerTest extends TestCase
|
||||
/**
|
||||
* No currency information
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController::store
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::authorize
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::rules
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::getAll
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest
|
||||
*/
|
||||
public function testNoCurrencyInfo(): void
|
||||
{
|
||||
@ -233,7 +227,9 @@ class AccountControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController::show
|
||||
* Show an account.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController:
|
||||
*/
|
||||
|
||||
public function testShow(): void
|
||||
@ -268,10 +264,8 @@ class AccountControllerTest extends TestCase
|
||||
/**
|
||||
* Name already in use.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController::store
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::authorize
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::rules
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::getAll
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest
|
||||
*/
|
||||
public function testStoreNotUnique(): void
|
||||
{
|
||||
@ -300,7 +294,7 @@ class AccountControllerTest extends TestCase
|
||||
[
|
||||
'message' => 'The given data was invalid.',
|
||||
'errors' => [
|
||||
'name' => ['This account name is already in use'],
|
||||
'name' => ['This account name is already in use.'],
|
||||
],
|
||||
]
|
||||
);
|
||||
@ -310,10 +304,8 @@ class AccountControllerTest extends TestCase
|
||||
/**
|
||||
* Send correct data. Should call account repository store method.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController::store
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::authorize
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::rules
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::getAll
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest
|
||||
*/
|
||||
public function testStoreValid(): void
|
||||
{
|
||||
@ -354,10 +346,8 @@ class AccountControllerTest extends TestCase
|
||||
/**
|
||||
* Send correct data. Should call account repository store method.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController::store
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::authorize
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::rules
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::getAll
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest
|
||||
*/
|
||||
public function testStoreWithCurrencyCode(): void
|
||||
{
|
||||
@ -402,8 +392,8 @@ class AccountControllerTest extends TestCase
|
||||
/**
|
||||
* Update first asset account we find. Name can be the same as it was.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController::update
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::rules
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest
|
||||
*/
|
||||
public function testUpdate(): void
|
||||
{
|
||||
@ -445,8 +435,8 @@ class AccountControllerTest extends TestCase
|
||||
/**
|
||||
* Update first asset account we find. Name can be the same as it was.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController::update
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest::rules
|
||||
* @covers \FireflyIII\Api\V1\Controllers\AccountController
|
||||
* @covers \FireflyIII\Api\V1\Requests\AccountRequest
|
||||
*/
|
||||
public function testUpdateCurrencyCode(): void
|
||||
{
|
||||
|
@ -27,6 +27,7 @@ namespace Tests\Api\V1\Controllers;
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Collection;
|
||||
use Laravel\Passport\Passport;
|
||||
use Log;
|
||||
use Tests\TestCase;
|
||||
@ -70,8 +71,9 @@ class BillControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\BillController::__construct
|
||||
* @covers \FireflyIII\Api\V1\Controllers\BillController::index
|
||||
* Show all bills
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\BillController
|
||||
*/
|
||||
public function testIndex(): void
|
||||
{
|
||||
@ -82,8 +84,9 @@ class BillControllerTest extends TestCase
|
||||
$repository = $this->mock(BillRepositoryInterface::class);
|
||||
|
||||
// mock calls:
|
||||
$repository->shouldReceive('setUser')->once();
|
||||
$repository->shouldReceive('setUser');
|
||||
$repository->shouldReceive('getPaginator')->withAnyArgs()->andReturn($paginator)->once();
|
||||
$repository->shouldReceive('getRulesForBill')->withAnyArgs()->andReturn(new Collection());
|
||||
|
||||
// test API
|
||||
$response = $this->get('/api/v1/bills');
|
||||
@ -97,7 +100,9 @@ class BillControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\BillController::show
|
||||
* Show one bill
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\BillController
|
||||
*/
|
||||
public function testShow(): void
|
||||
{
|
||||
@ -106,8 +111,8 @@ class BillControllerTest extends TestCase
|
||||
$repository = $this->mock(BillRepositoryInterface::class);
|
||||
|
||||
// mock calls:
|
||||
$repository->shouldReceive('setUser')->once();
|
||||
|
||||
$repository->shouldReceive('setUser');
|
||||
$repository->shouldReceive('getRulesForBill')->withAnyArgs()->andReturn(new Collection());
|
||||
// test API
|
||||
$response = $this->get('/api/v1/bills/' . $bill->id);
|
||||
$response->assertStatus(200);
|
||||
@ -121,11 +126,9 @@ class BillControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\BillController::store
|
||||
* @covers \FireflyIII\Api\V1\Requests\BillRequest::rules
|
||||
* @covers \FireflyIII\Api\V1\Requests\BillRequest::authorize
|
||||
* @covers \FireflyIII\Api\V1\Requests\BillRequest::getAll
|
||||
* @covers \FireflyIII\Api\V1\Requests\BillRequest::withValidator
|
||||
* Store with minimum amount more than maximum amount
|
||||
* @covers \FireflyIII\Api\V1\Controllers\BillController
|
||||
* @covers \FireflyIII\Api\V1\Requests\BillRequest
|
||||
*/
|
||||
public function testStoreMinOverMax(): void
|
||||
{
|
||||
@ -167,10 +170,10 @@ class BillControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\BillController::store
|
||||
* @covers \FireflyIII\Api\V1\Requests\BillRequest::rules
|
||||
* @covers \FireflyIII\Api\V1\Requests\BillRequest::authorize
|
||||
* @covers \FireflyIII\Api\V1\Requests\BillRequest::getAll
|
||||
* Store a valid bill
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\BillController
|
||||
* @covers \FireflyIII\Api\V1\Requests\BillRequest
|
||||
*/
|
||||
public function testStoreValid(): void
|
||||
{
|
||||
@ -179,9 +182,9 @@ class BillControllerTest extends TestCase
|
||||
$repository = $this->mock(BillRepositoryInterface::class);
|
||||
|
||||
// mock calls:
|
||||
$repository->shouldReceive('setUser')->once();
|
||||
$repository->shouldReceive('setUser')->times(2);
|
||||
$repository->shouldReceive('store')->andReturn($bill);
|
||||
|
||||
$repository->shouldReceive('getRulesForBill')->withAnyArgs()->andReturn(new Collection());
|
||||
// data to submit:
|
||||
$data = [
|
||||
'name' => 'New bill #' . random_int(1, 1000),
|
||||
@ -206,10 +209,10 @@ class BillControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\BillController::update
|
||||
* @covers \FireflyIII\Api\V1\Requests\BillRequest::rules
|
||||
* @covers \FireflyIII\Api\V1\Requests\BillRequest::authorize
|
||||
* @covers \FireflyIII\Api\V1\Requests\BillRequest::getAll
|
||||
* Update a valid bill.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\BillController
|
||||
* @covers \FireflyIII\Api\V1\Requests\BillRequest
|
||||
*/
|
||||
public function testUpdateValid(): void
|
||||
{
|
||||
@ -218,9 +221,9 @@ class BillControllerTest extends TestCase
|
||||
$repository = $this->mock(BillRepositoryInterface::class);
|
||||
|
||||
// mock calls:
|
||||
$repository->shouldReceive('setUser')->once();
|
||||
$repository->shouldReceive('setUser')->times(2);
|
||||
$repository->shouldReceive('update')->andReturn($bill);
|
||||
|
||||
$repository->shouldReceive('getRulesForBill')->withAnyArgs()->andReturn(new Collection());
|
||||
// data to submit:
|
||||
$data = [
|
||||
'name' => 'New bill #' . random_int(1, 1000),
|
||||
|
@ -102,7 +102,7 @@ class CurrencyControllerTest extends TestCase
|
||||
'pagination' => [
|
||||
'total' => $collection->count(),
|
||||
'count' => $collection->count(),
|
||||
'per_page' => 100,
|
||||
'per_page' => true, // depends on user preference.
|
||||
'current_page' => 1,
|
||||
'total_pages' => 1,
|
||||
],
|
||||
@ -142,6 +142,8 @@ class CurrencyControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* Store new currency.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\CurrencyController
|
||||
* @covers \FireflyIII\Api\V1\Requests\CurrencyRequest
|
||||
*/
|
||||
@ -173,6 +175,8 @@ class CurrencyControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* Store new currency and make it default.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\CurrencyController
|
||||
* @covers \FireflyIII\Api\V1\Requests\CurrencyRequest
|
||||
*/
|
||||
@ -208,6 +212,8 @@ class CurrencyControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* Update currency.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\CurrencyController
|
||||
* @covers \FireflyIII\Api\V1\Requests\CurrencyRequest
|
||||
*/
|
||||
@ -238,6 +244,8 @@ class CurrencyControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* Update currency and make default.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\CurrencyController
|
||||
* @covers \FireflyIII\Api\V1\Requests\CurrencyRequest
|
||||
*/
|
||||
|
@ -54,10 +54,9 @@ class TransactionControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy account over API.
|
||||
* Destroy journal over API.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::__construct
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::delete
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
*/
|
||||
public function testDelete(): void
|
||||
{
|
||||
@ -80,7 +79,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit with bad currency code
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testFailCurrencyCode(): void
|
||||
@ -127,7 +126,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit with bad currency ID.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testFailCurrencyId(): void
|
||||
@ -173,7 +172,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Empty descriptions
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testFailEmptyDescriptions(): void
|
||||
@ -225,7 +224,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit all empty descriptions for transactions.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testFailEmptySplitDescriptions(): void
|
||||
@ -282,7 +281,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submitted expense account instead of asset account.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
* @covers \FireflyIII\Rules\BelongsUser
|
||||
*/
|
||||
@ -331,7 +330,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submitted expense account name instead of asset account name.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testFailExpenseName(): void
|
||||
@ -378,7 +377,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit no asset account info at all.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testFailNoAsset(): void
|
||||
@ -422,7 +421,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit no transactions.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testFailNoData(): void
|
||||
@ -459,7 +458,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit foreign currency without foreign currency info.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testFailNoForeignCurrencyInfo(): void
|
||||
@ -507,7 +506,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit revenue ID instead of expense ID.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testFailOpposingRevenueID(): void
|
||||
@ -559,9 +558,9 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit journal with a bill ID that is not yours.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
* @covers \FireflyiII\Rules\BelongsUser
|
||||
* @covers \FireflyIII\Rules\BelongsUser
|
||||
*/
|
||||
public function testFailOwnershipBillId(): void
|
||||
{
|
||||
@ -616,11 +615,11 @@ class TransactionControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit journal with a bill ID that is not yours.
|
||||
* Submit journal with a bill name that is not yours.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
* @covers \FireflyiII\Rules\BelongsUser
|
||||
* @covers \FireflyIII\Rules\BelongsUser
|
||||
*/
|
||||
public function testFailOwnershipBillName(): void
|
||||
{
|
||||
@ -676,9 +675,9 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit journal with a budget ID that is not yours.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
* @covers \FireflyiII\Rules\BelongsUser
|
||||
* @covers \FireflyIII\Rules\BelongsUser
|
||||
*/
|
||||
public function testFailOwnershipBudgetId(): void
|
||||
{
|
||||
@ -734,9 +733,9 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit journal with a budget name that is not yours.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
* @covers \FireflyiII\Rules\BelongsUser
|
||||
* @covers \FireflyIII\Rules\BelongsUser
|
||||
*/
|
||||
public function testFailOwnershipBudgetName(): void
|
||||
{
|
||||
@ -792,9 +791,9 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit journal with a category ID that is not yours.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
* @covers \FireflyiII\Rules\BelongsUser
|
||||
* @covers \FireflyIII\Rules\BelongsUser
|
||||
*/
|
||||
public function testFailOwnershipCategoryId(): void
|
||||
{
|
||||
@ -850,9 +849,9 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit journal with a piggy bank that is not yours.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
* @covers \FireflyiII\Rules\BelongsUser
|
||||
* @covers \FireflyIII\Rules\BelongsUser
|
||||
*/
|
||||
public function testFailOwnershipPiggyBankID(): void
|
||||
{
|
||||
@ -916,9 +915,9 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit journal with a piggy bank that is not yours.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
* @covers \FireflyiII\Rules\BelongsUser
|
||||
* @covers \FireflyIII\Rules\BelongsUser
|
||||
*/
|
||||
public function testFailOwnershipPiggyBankName(): void
|
||||
{
|
||||
@ -982,7 +981,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submitted revenue account instead of asset account in deposit.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
* @covers \FireflyIII\Rules\BelongsUser
|
||||
*/
|
||||
@ -1029,7 +1028,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Try to store a withdrawal with different source accounts.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testFailSplitDeposit(): void
|
||||
@ -1086,7 +1085,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Try to store a withdrawal with different source accounts.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testFailSplitTransfer(): void
|
||||
@ -1139,7 +1138,7 @@ class TransactionControllerTest extends TestCase
|
||||
'All accounts in this field must be equal.',
|
||||
],
|
||||
'transactions.1.destination_id' => [
|
||||
'The source account equals the destination account',
|
||||
'The source account equals the destination account.',
|
||||
],
|
||||
],
|
||||
]
|
||||
@ -1150,7 +1149,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Try to store a withdrawal with different source accounts.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testFailSplitWithdrawal(): void
|
||||
@ -1206,11 +1205,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Show index.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::__construct
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::index
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::mapTypes
|
||||
*
|
||||
* throws \FireflyIII\Exceptions\FireflyException
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
*/
|
||||
public function testIndex(): void
|
||||
{
|
||||
@ -1261,10 +1256,9 @@ class TransactionControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::__construct
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::index
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::mapTypes
|
||||
* throws \FireflyIII\Exceptions\FireflyException
|
||||
* Show index with range.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
*/
|
||||
public function testIndexWithRange(): void
|
||||
{
|
||||
@ -1329,7 +1323,9 @@ class TransactionControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::show
|
||||
* Show a deposit.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
*/
|
||||
public function testShowDeposit(): void
|
||||
{
|
||||
@ -1390,7 +1386,9 @@ class TransactionControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::show
|
||||
* Show a withdrawal.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
*/
|
||||
public function testShowWithdrawal(): void
|
||||
{
|
||||
@ -1460,7 +1458,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit a transaction (withdrawal) with attached bill ID
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessBillId(): void
|
||||
@ -1501,7 +1499,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit a transaction (withdrawal) with attached bill ID
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessBillName(): void
|
||||
@ -1542,7 +1540,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Add opposing account by a new name.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessNewStoreOpposingName(): void
|
||||
@ -1582,7 +1580,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit the minimum amount of data required to create a withdrawal.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreAccountName(): void
|
||||
@ -1621,7 +1619,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit the minimum amount of data required to create a withdrawal.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreBasic(): void
|
||||
@ -1660,7 +1658,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit the minimum amount of data required to create a withdrawal.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreBasicByName(): void
|
||||
@ -1701,7 +1699,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit the minimum amount of data required to create a deposit.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreBasicDeposit(): void
|
||||
@ -1740,7 +1738,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit with existing budget ID, see it reflected in output.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreBudgetId(): void
|
||||
@ -1779,7 +1777,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit with existing budget name, see it reflected in output.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreBudgetName(): void
|
||||
@ -1819,7 +1817,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit with existing category ID, see it reflected in output.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreCategoryID(): void
|
||||
@ -1858,7 +1856,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit with existing category name, see it reflected in output.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreCategoryName(): void
|
||||
@ -1897,7 +1895,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Add foreign amount information.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreForeignAmount(): void
|
||||
@ -1938,7 +1936,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Add all available meta data fields.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreMetaData(): void
|
||||
@ -1983,7 +1981,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit with NEW category name, see it reflected in output.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreNewCategoryName(): void
|
||||
@ -2023,7 +2021,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Add opposing account by name.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreNewOpposingName(): void
|
||||
@ -2063,7 +2061,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit the minimum amount of data required to create a withdrawal.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreNotes(): void
|
||||
@ -2102,7 +2100,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Add opposing account by ID.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreOpposingID(): void
|
||||
@ -2141,7 +2139,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Add opposing account by name.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreOpposingName(): void
|
||||
@ -2182,7 +2180,7 @@ class TransactionControllerTest extends TestCase
|
||||
* Submit the minimum amount of data required to create a withdrawal.
|
||||
* When sending a piggy bank by name, this must be reflected in the output.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStorePiggyDeposit(): void
|
||||
@ -2221,7 +2219,7 @@ class TransactionControllerTest extends TestCase
|
||||
* Submit the minimum amount of data required to create a withdrawal.
|
||||
* When sending a piggy bank by name, this must be reflected in the output.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStorePiggyId(): void
|
||||
@ -2261,7 +2259,7 @@ class TransactionControllerTest extends TestCase
|
||||
* Submit the minimum amount of data required to create a withdrawal.
|
||||
* When sending a piggy bank by name, this must be reflected in the output.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStorePiggyName(): void
|
||||
@ -2300,7 +2298,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Set a different reconciled var
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreReconciled(): void
|
||||
@ -2338,7 +2336,7 @@ class TransactionControllerTest extends TestCase
|
||||
/**
|
||||
* Submit the data required for a split withdrawal.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreSplit(): void
|
||||
@ -2385,7 +2383,7 @@ class TransactionControllerTest extends TestCase
|
||||
* Submit the minimum amount of data required to create a withdrawal.
|
||||
* Add some tags as well. Expect to see them in the result.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::store
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testSuccessStoreTags(): void
|
||||
@ -2429,7 +2427,7 @@ class TransactionControllerTest extends TestCase
|
||||
* Fire enough to trigger an update. Since the create code already fires on the Request, no
|
||||
* need to verify all of that.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::update
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testUpdateBasicDeposit(): void
|
||||
@ -2470,7 +2468,7 @@ class TransactionControllerTest extends TestCase
|
||||
* Fire enough to trigger an update. Since the create code already fires on the Request, no
|
||||
* need to verify all of that.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController::update
|
||||
* @covers \FireflyIII\Api\V1\Controllers\TransactionController
|
||||
* @covers \FireflyIII\Api\V1\Requests\TransactionRequest
|
||||
*/
|
||||
public function testUpdateBasicWithdrawal(): void
|
||||
|
@ -50,8 +50,7 @@ class UserControllerTest extends TestCase
|
||||
/**
|
||||
* Delete a user.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController::__construct
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController::delete
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserRequest
|
||||
*/
|
||||
public function testDelete(): void
|
||||
@ -68,8 +67,7 @@ class UserControllerTest extends TestCase
|
||||
/**
|
||||
* Delete a user as non admin
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController::__construct
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController::delete
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserRequest
|
||||
*/
|
||||
public function testDeleteNoAdmin(): void
|
||||
@ -86,8 +84,9 @@ class UserControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController::__construct
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController::index
|
||||
* Show list of users.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController
|
||||
*/
|
||||
public function testIndex(): void
|
||||
{
|
||||
@ -111,7 +110,9 @@ class UserControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController::show
|
||||
* Show single user.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController
|
||||
*/
|
||||
public function testShow(): void
|
||||
{
|
||||
@ -124,7 +125,9 @@ class UserControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController::store
|
||||
* Store new user.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserRequest
|
||||
*/
|
||||
public function testStoreBasic(): void
|
||||
@ -145,7 +148,9 @@ class UserControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController::store
|
||||
* Store user with info already used.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserRequest
|
||||
*/
|
||||
public function testStoreNotUnique(): void
|
||||
@ -174,7 +179,9 @@ class UserControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController::update
|
||||
* Update user.
|
||||
*
|
||||
* @covers \FireflyIII\Api\V1\Controllers\UserController:
|
||||
* @covers \FireflyIII\Api\V1\Requests\UserRequest
|
||||
*/
|
||||
public function testUpdate(): void
|
||||
|
@ -37,10 +37,6 @@ use Mockery;
|
||||
|
||||
/**
|
||||
* Class ConfigurationControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class ReconcileControllerTest extends TestCase
|
||||
{
|
||||
@ -54,7 +50,9 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::edit
|
||||
* Test editing a reconciliation.
|
||||
*
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
*/
|
||||
public function testEdit(): void
|
||||
{
|
||||
@ -76,7 +74,9 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::edit
|
||||
* Test the redirect if journal is not a reconciliation.
|
||||
*
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
*/
|
||||
public function testEditRedirect(): void
|
||||
{
|
||||
@ -88,7 +88,9 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::overview()
|
||||
* Test overview of reconciliation.
|
||||
*
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
*/
|
||||
public function testOverview(): void
|
||||
{
|
||||
@ -109,7 +111,9 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::overview()
|
||||
* Test overview when it's not an asset.
|
||||
*
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
* @expectedExceptionMessage is not an asset account
|
||||
*/
|
||||
public function testOverviewNotAsset(): void
|
||||
@ -127,9 +131,9 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::reconcile()
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::redirectToOriginalAccount()
|
||||
* Test showing the reconciliation.
|
||||
*
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
*/
|
||||
public function testReconcile(): void
|
||||
{
|
||||
@ -144,9 +148,9 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::reconcile()
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::redirectToOriginalAccount()
|
||||
* Test showing the reconciliation (its a initial balance).
|
||||
*
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
*/
|
||||
public function testReconcileInitialBalance(): void
|
||||
{
|
||||
@ -158,9 +162,9 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::reconcile()
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::redirectToOriginalAccount()
|
||||
* Test reconcile view (without date info).
|
||||
*
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
*/
|
||||
public function testReconcileNoDates(): void
|
||||
{
|
||||
@ -176,9 +180,9 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::reconcile()
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::redirectToOriginalAccount()
|
||||
* Test reconcile view (without end date).
|
||||
*
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
*/
|
||||
public function testReconcileNoEndDate(): void
|
||||
{
|
||||
@ -194,9 +198,9 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::reconcile()
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::redirectToOriginalAccount()
|
||||
* Test reconcile view when account is not an asset.
|
||||
*
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
*/
|
||||
public function testReconcileNotAsset(): void
|
||||
{
|
||||
@ -207,7 +211,9 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::show()
|
||||
* Test show for actual reconciliation.
|
||||
*
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
*/
|
||||
public function testShow(): void
|
||||
{
|
||||
@ -225,7 +231,9 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::show()
|
||||
* Test show for actual reconciliation, but its not a reconciliation.
|
||||
*
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
*/
|
||||
public function testShowSomethingElse(): void
|
||||
{
|
||||
@ -237,7 +245,9 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::submit()
|
||||
* Submit reconciliation.
|
||||
*
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
* @covers \FireflyIII\Http\Requests\ReconciliationStoreRequest
|
||||
*/
|
||||
public function testSubmit(): void
|
||||
@ -266,7 +276,9 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::transactions()
|
||||
* List transactions for reconciliation view.
|
||||
*
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
*/
|
||||
public function testTransactions(): void
|
||||
{
|
||||
@ -279,7 +291,7 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::transactions()
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
*/
|
||||
public function testTransactionsInitialBalance(): void
|
||||
{
|
||||
@ -291,7 +303,7 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::update
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
* @covers \FireflyIII\Http\Requests\ReconciliationUpdateRequest
|
||||
*/
|
||||
public function testUpdate(): void
|
||||
@ -314,7 +326,7 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::update
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
* @covers \FireflyIII\Http\Requests\ReconciliationUpdateRequest
|
||||
*/
|
||||
public function testUpdateNotReconcile(): void
|
||||
@ -331,7 +343,7 @@ class ReconcileControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController::update
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ReconcileController
|
||||
* @covers \FireflyIII\Http\Requests\ReconciliationUpdateRequest
|
||||
*/
|
||||
public function testUpdateZero(): void
|
||||
|
@ -29,10 +29,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class ConfigurationControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class ConfigurationControllerTest extends TestCase
|
||||
{
|
||||
|
@ -29,10 +29,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class HomeControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class HomeControllerTest extends TestCase
|
||||
{
|
||||
@ -46,8 +42,7 @@ class HomeControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\HomeController::index
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\HomeController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\HomeController
|
||||
*/
|
||||
public function testIndex(): void
|
||||
{
|
||||
@ -58,6 +53,9 @@ class HomeControllerTest extends TestCase
|
||||
$response->assertSee('<ol class="breadcrumb">');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\HomeController
|
||||
*/
|
||||
public function testTestMessage(): void
|
||||
{
|
||||
Event::fake();
|
||||
|
@ -30,10 +30,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class LinkControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class LinkControllerTest extends TestCase
|
||||
{
|
||||
@ -47,8 +43,7 @@ class LinkControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController::create
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController
|
||||
*/
|
||||
public function testCreate(): void
|
||||
{
|
||||
@ -59,7 +54,7 @@ class LinkControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController::delete
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController
|
||||
*/
|
||||
public function testDeleteEditable(): void
|
||||
{
|
||||
@ -76,7 +71,7 @@ class LinkControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController::delete
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController
|
||||
*/
|
||||
public function testDeleteNonEditable(): void
|
||||
{
|
||||
@ -89,7 +84,7 @@ class LinkControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController::destroy
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController
|
||||
*/
|
||||
public function testDestroy(): void
|
||||
{
|
||||
@ -99,7 +94,7 @@ class LinkControllerTest extends TestCase
|
||||
LinkType::create(['editable' => 1, 'inward' => 'hellox', 'outward' => 'byex', 'name' => 'Test typeX']);
|
||||
|
||||
$linkType = LinkType::where('editable', 1)->first();
|
||||
$repository->shouldReceive('find')->andReturn($linkType);
|
||||
$repository->shouldReceive('findNull')->andReturn($linkType);
|
||||
$repository->shouldReceive('destroy');
|
||||
$this->be($this->user());
|
||||
$this->session(['link_types.delete.uri' => 'http://localhost']);
|
||||
@ -109,7 +104,7 @@ class LinkControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController::edit
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController
|
||||
*/
|
||||
public function testEditEditable(): void
|
||||
{
|
||||
@ -123,7 +118,7 @@ class LinkControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController::edit
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController
|
||||
*/
|
||||
public function testEditNonEditable(): void
|
||||
{
|
||||
@ -135,7 +130,7 @@ class LinkControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController::index
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController
|
||||
*/
|
||||
public function testIndex(): void
|
||||
{
|
||||
@ -149,7 +144,7 @@ class LinkControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController::show
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController
|
||||
*/
|
||||
public function testShow(): void
|
||||
{
|
||||
@ -160,7 +155,7 @@ class LinkControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController::store
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController
|
||||
* @covers \FireflyIII\Http\Requests\LinkTypeFormRequest
|
||||
*/
|
||||
public function testStore(): void
|
||||
@ -172,7 +167,7 @@ class LinkControllerTest extends TestCase
|
||||
'outward' => 'test outward' . random_int(1, 1000),
|
||||
];
|
||||
$repository->shouldReceive('store')->once()->andReturn(LinkType::first());
|
||||
$repository->shouldReceive('find')->andReturn(LinkType::first());
|
||||
$repository->shouldReceive('findNull')->andReturn(LinkType::first());
|
||||
|
||||
$this->session(['link_types.create.uri' => 'http://localhost']);
|
||||
$this->be($this->user());
|
||||
@ -182,7 +177,7 @@ class LinkControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController::store
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController
|
||||
* @covers \FireflyIII\Http\Requests\LinkTypeFormRequest
|
||||
*/
|
||||
public function testStoreRedirect(): void
|
||||
@ -203,7 +198,7 @@ class LinkControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController::update
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController
|
||||
* @covers \FireflyIII\Http\Requests\LinkTypeFormRequest
|
||||
*/
|
||||
public function testUpdate(): void
|
||||
@ -227,7 +222,7 @@ class LinkControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController::update
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController
|
||||
* @covers \FireflyIII\Http\Requests\LinkTypeFormRequest
|
||||
*/
|
||||
public function testUpdateNonEditable(): void
|
||||
@ -249,7 +244,7 @@ class LinkControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController::update
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\LinkController
|
||||
* @covers \FireflyIII\Http\Requests\LinkTypeFormRequest
|
||||
*/
|
||||
public function testUpdateRedirect(): void
|
||||
|
@ -34,10 +34,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class UpdateControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class UpdateControllerTest extends TestCase
|
||||
{
|
||||
@ -51,8 +47,7 @@ class UpdateControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UpdateController::index
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UpdateController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UpdateController
|
||||
*/
|
||||
public function testIndex(): void
|
||||
{
|
||||
@ -75,7 +70,7 @@ class UpdateControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UpdateController::post
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UpdateController
|
||||
*/
|
||||
public function testPost(): void
|
||||
{
|
||||
@ -93,7 +88,7 @@ class UpdateControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UpdateController::updateCheck
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UpdateController
|
||||
*/
|
||||
public function testUpdateCheck(): void
|
||||
{
|
||||
@ -122,7 +117,7 @@ class UpdateControllerTest extends TestCase
|
||||
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UpdateController::updateCheck
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UpdateController
|
||||
*/
|
||||
public function testUpdateCheckCurrent(): void
|
||||
{
|
||||
@ -149,7 +144,7 @@ class UpdateControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UpdateController::updateCheck
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UpdateController
|
||||
*/
|
||||
public function testUpdateCheckError(): void
|
||||
{
|
||||
@ -172,7 +167,7 @@ class UpdateControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UpdateController::updateCheck
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UpdateController
|
||||
*/
|
||||
public function testUpdateCheckNewer(): void
|
||||
{
|
||||
|
@ -29,10 +29,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class UserControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class UserControllerTest extends TestCase
|
||||
{
|
||||
@ -46,7 +42,7 @@ class UserControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UserController::delete
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UserController
|
||||
*/
|
||||
public function testDelete(): void
|
||||
{
|
||||
@ -58,7 +54,7 @@ class UserControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UserController::destroy
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UserController
|
||||
*/
|
||||
public function testDestroy(): void
|
||||
{
|
||||
@ -71,7 +67,7 @@ class UserControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UserController::edit
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UserController
|
||||
*/
|
||||
public function testEdit(): void
|
||||
{
|
||||
@ -83,8 +79,7 @@ class UserControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UserController::index
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UserController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UserController
|
||||
*/
|
||||
public function testIndex(): void
|
||||
{
|
||||
@ -100,7 +95,7 @@ class UserControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UserController::show
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UserController
|
||||
*/
|
||||
public function testShow(): void
|
||||
{
|
||||
@ -121,7 +116,7 @@ class UserControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UserController::update
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\UserController
|
||||
*/
|
||||
public function testUpdate(): void
|
||||
{
|
||||
|
@ -28,10 +28,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class ForgotPasswordControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class ForgotPasswordControllerTest extends TestCase
|
||||
{
|
||||
@ -45,8 +41,7 @@ class ForgotPasswordControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\ForgotPasswordController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\ForgotPasswordController::sendResetLinkEmail
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\ForgotPasswordController
|
||||
*/
|
||||
public function testSendResetLinkEmail(): void
|
||||
{
|
||||
@ -62,8 +57,7 @@ class ForgotPasswordControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\ForgotPasswordController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\ForgotPasswordController::sendResetLinkEmail
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\ForgotPasswordController
|
||||
*/
|
||||
public function testSendResetLinkEmailDemo(): void
|
||||
{
|
||||
|
@ -30,10 +30,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class TwoFactorControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class TwoFactorControllerTest extends TestCase
|
||||
{
|
||||
@ -47,7 +43,7 @@ class TwoFactorControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\TwoFactorController::index
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\TwoFactorController
|
||||
*/
|
||||
public function testIndex(): void
|
||||
{
|
||||
@ -70,7 +66,7 @@ class TwoFactorControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\TwoFactorController::index
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\TwoFactorController
|
||||
*/
|
||||
public function testIndexNo2FA(): void
|
||||
{
|
||||
@ -92,7 +88,7 @@ class TwoFactorControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\TwoFactorController::index
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\TwoFactorController
|
||||
* @expectedExceptionMessage Your two factor authentication secret is empty
|
||||
*/
|
||||
public function testIndexNoSecret(): void
|
||||
@ -116,7 +112,7 @@ class TwoFactorControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\TwoFactorController::lostTwoFactor
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\TwoFactorController
|
||||
*/
|
||||
public function testLostTwoFactor(): void
|
||||
{
|
||||
@ -139,7 +135,7 @@ class TwoFactorControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\TwoFactorController::postIndex
|
||||
* @covers \FireflyIII\Http\Controllers\Auth\TwoFactorController
|
||||
*/
|
||||
public function testPostIndex(): void
|
||||
{
|
||||
|
@ -43,10 +43,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class AccountControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class AccountControllerTest extends TestCase
|
||||
{
|
||||
@ -60,8 +56,8 @@ class AccountControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::expenseAccounts
|
||||
* @covers \FireflyIII\Generator\Chart\Basic\GeneratorInterface::singleSet
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController
|
||||
* @covers \FireflyIII\Generator\Chart\Basic\GeneratorInterface
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -84,8 +80,7 @@ class AccountControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::expenseBudget
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::getBudgetNames
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -112,8 +107,7 @@ class AccountControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::expenseBudgetAll
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::getBudgetNames
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -142,8 +136,7 @@ class AccountControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::expenseCategory
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::getCategoryNames
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -171,8 +164,7 @@ class AccountControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::expenseCategoryAll
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::getCategoryNames
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -202,10 +194,8 @@ class AccountControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::frontpage
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::accountBalanceChart
|
||||
* @covers \FireflyIII\Generator\Chart\Basic\GeneratorInterface::multiSet
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController
|
||||
* @covers \FireflyIII\Generator\Chart\Basic\GeneratorInterface
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -232,7 +222,7 @@ class AccountControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::incomeCategory
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -260,7 +250,7 @@ class AccountControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::incomeCategoryAll
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -290,7 +280,7 @@ class AccountControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::period
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -311,8 +301,7 @@ class AccountControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::report
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::accountBalanceChart
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController
|
||||
*/
|
||||
public function testReport(): void
|
||||
{
|
||||
@ -328,7 +317,7 @@ class AccountControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::revenueAccounts
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
|
@ -32,10 +32,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class BillControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class BillControllerTest extends TestCase
|
||||
{
|
||||
@ -49,8 +45,7 @@ class BillControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BillController::frontpage
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BillController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BillController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -71,7 +66,7 @@ class BillControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BillController::single
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BillController
|
||||
*/
|
||||
public function testSingle(): void
|
||||
{
|
||||
|
@ -40,10 +40,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class BudgetControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class BudgetControllerTest extends TestCase
|
||||
{
|
||||
@ -57,8 +53,7 @@ class BudgetControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::budget
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -79,7 +74,7 @@ class BudgetControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::budgetLimit
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -99,7 +94,7 @@ class BudgetControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::budgetLimit
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController
|
||||
* @expectedExceptionMessage This budget limit is not part of this budget.
|
||||
*/
|
||||
public function testBudgetLimitWrongLimit(): void
|
||||
@ -113,8 +108,7 @@ class BudgetControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::expenseAsset
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::getAccountNames
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -142,8 +136,7 @@ class BudgetControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::expenseCategory
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::getCategoryNames
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -176,8 +169,7 @@ class BudgetControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::expenseExpense
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::getAccountNames
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -210,10 +202,7 @@ class BudgetControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::frontpage
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::getExpensesForBudget
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::spentInPeriodWithout
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::spentInPeriodMulti
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -247,10 +236,7 @@ class BudgetControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::frontpage
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::getExpensesForBudget
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::spentInPeriodWithout
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::spentInPeriodMulti
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -286,10 +272,7 @@ class BudgetControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::frontpage
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::getExpensesForBudget
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::spentInPeriodWithout
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::spentInPeriodMulti
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -321,8 +304,7 @@ class BudgetControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::period
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::getBudgetedInPeriod
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController
|
||||
*/
|
||||
public function testPeriod(): void
|
||||
{
|
||||
@ -342,7 +324,7 @@ class BudgetControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::periodNoBudget
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController
|
||||
*/
|
||||
public function testPeriodNoBudget(): void
|
||||
{
|
||||
|
@ -39,10 +39,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class BudgetReportControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class BudgetReportControllerTest extends TestCase
|
||||
{
|
||||
@ -56,8 +52,7 @@ class BudgetReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetReportController::accountExpense
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetReportController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetReportController
|
||||
*/
|
||||
public function testAccountExpense(): void
|
||||
{
|
||||
@ -80,7 +75,7 @@ class BudgetReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetReportController::budgetExpense
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetReportController
|
||||
*/
|
||||
public function testBudgetExpense(): void
|
||||
{
|
||||
@ -102,10 +97,7 @@ class BudgetReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetReportController::mainChart
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetReportController::filterBudgetLimits
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetReportController::getExpenses
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetReportController::groupByBudget
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetReportController
|
||||
*/
|
||||
public function testMainChart(): void
|
||||
{
|
||||
|
@ -35,10 +35,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class CategoryControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class CategoryControllerTest extends TestCase
|
||||
{
|
||||
@ -52,8 +48,7 @@ class CategoryControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryController::all
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -80,7 +75,7 @@ class CategoryControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryController::frontpage
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
@ -106,7 +101,7 @@ class CategoryControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryController::reportPeriod
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryController
|
||||
*/
|
||||
public function testReportPeriod(): void
|
||||
{
|
||||
@ -123,7 +118,7 @@ class CategoryControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryController::reportPeriodNoCategory
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryController
|
||||
*/
|
||||
public function testReportPeriodNoCategory(): void
|
||||
{
|
||||
@ -140,8 +135,7 @@ class CategoryControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryController::specificPeriod
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryController::makePeriodChart
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
|
@ -36,10 +36,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class CategoryReportControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class CategoryReportControllerTest extends TestCase
|
||||
{
|
||||
@ -53,8 +49,7 @@ class CategoryReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::accountExpense
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController
|
||||
*/
|
||||
public function testAccountExpense(): void
|
||||
{
|
||||
@ -75,7 +70,7 @@ class CategoryReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::accountIncome
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController
|
||||
*/
|
||||
public function testAccountIncome(): void
|
||||
{
|
||||
@ -96,7 +91,7 @@ class CategoryReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::categoryExpense
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController
|
||||
*/
|
||||
public function testCategoryExpense(): void
|
||||
{
|
||||
@ -117,7 +112,7 @@ class CategoryReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::categoryIncome
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController
|
||||
*/
|
||||
public function testCategoryIncome(): void
|
||||
{
|
||||
@ -138,10 +133,7 @@ class CategoryReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::mainChart
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::groupByCategory
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::getExpenses
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::getIncome
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController
|
||||
*/
|
||||
public function testMainChart(): void
|
||||
{
|
||||
|
@ -33,10 +33,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class ExpenseReportControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class ExpenseReportControllerTest extends TestCase
|
||||
{
|
||||
@ -51,12 +47,7 @@ class ExpenseReportControllerTest extends TestCase
|
||||
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ExpenseReportController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ExpenseReportController::groupByName
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ExpenseReportController::mainChart()
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ExpenseReportController::getExpenses
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ExpenseReportController::getIncome
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ExpenseReportController::combineAccounts
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ExpenseReportController
|
||||
*/
|
||||
public function testMainChart(): void
|
||||
{
|
||||
|
@ -31,10 +31,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class PiggyBankControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class PiggyBankControllerTest extends TestCase
|
||||
{
|
||||
@ -48,8 +44,7 @@ class PiggyBankControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\PiggyBankController::history
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\PiggyBankController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\PiggyBankController
|
||||
*/
|
||||
public function testHistory(): void
|
||||
{
|
||||
|
@ -30,10 +30,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class ReportControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class ReportControllerTest extends TestCase
|
||||
{
|
||||
@ -47,9 +43,7 @@ class ReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ReportController::netWorth
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ReportController::arraySum
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ReportController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ReportController
|
||||
*/
|
||||
public function testNetWorth(): void
|
||||
{
|
||||
@ -64,8 +58,7 @@ class ReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ReportController::operations
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ReportController::getChartData
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ReportController
|
||||
*/
|
||||
public function testOperations(): void
|
||||
{
|
||||
@ -83,8 +76,7 @@ class ReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ReportController::sum
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ReportController::getChartData
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ReportController
|
||||
*/
|
||||
public function testSum(): void
|
||||
{
|
||||
|
@ -40,10 +40,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class TagReportControllerTest
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class TagReportControllerTest extends TestCase
|
||||
{
|
||||
@ -57,8 +53,7 @@ class TagReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController::accountExpense
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController
|
||||
*/
|
||||
public function testAccountExpense(): void
|
||||
{
|
||||
@ -86,7 +81,7 @@ class TagReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController::accountIncome
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController
|
||||
*/
|
||||
public function testAccountIncome(): void
|
||||
{
|
||||
@ -113,7 +108,7 @@ class TagReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController::budgetExpense()
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController
|
||||
*/
|
||||
public function testBudgetExpense(): void
|
||||
{
|
||||
@ -139,7 +134,7 @@ class TagReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController::categoryExpense()
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController
|
||||
*/
|
||||
public function testCategoryExpense(): void
|
||||
{
|
||||
@ -165,10 +160,7 @@ class TagReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController::mainChart()
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController::getExpenses
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController::getIncome
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController::groupByTag
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController
|
||||
*/
|
||||
public function testMainChart(): void
|
||||
{
|
||||
@ -207,7 +199,7 @@ class TagReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController::tagExpense()
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController
|
||||
*/
|
||||
public function testTagExpense(): void
|
||||
{
|
||||
@ -233,7 +225,7 @@ class TagReportControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController::tagIncome
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\TagReportController
|
||||
*/
|
||||
public function testTagIncome(): void
|
||||
{
|
||||
|
@ -109,8 +109,6 @@ class PiggyBankControllerTest extends TestCase
|
||||
$currencyRepos->shouldReceive('findNull')->andReturn($currency);
|
||||
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$accountRepos->shouldReceive('getAccountsByType')
|
||||
->withArgs([[AccountType::ASSET, AccountType::DEFAULT]])->andReturn(new Collection([$account]))->once();
|
||||
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||
Amount::shouldReceive('balance')->andReturn('0');
|
||||
@ -196,13 +194,12 @@ class PiggyBankControllerTest extends TestCase
|
||||
public function testIndex(): void
|
||||
{
|
||||
// mock stuff
|
||||
$repository = $this->mock(PiggyBankRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$one = factory(PiggyBank::class)->make();
|
||||
$two = factory(PiggyBank::class)->make();
|
||||
$two->account_id = $one->account_id;
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
$repository->shouldReceive('getPiggyBanks')->andReturn(new Collection([$one, $two]));
|
||||
$first = $this->user()->transactionJournals()->inRandomOrder()->first();
|
||||
$repository = $this->mock(PiggyBankRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$piggies = $this->user()->piggyBanks()->take(2)->get();
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn($first);
|
||||
$repository->shouldReceive('getPiggyBanks')->andReturn($piggies);
|
||||
$repository->shouldReceive('getCurrentAmount')->andReturn('10');
|
||||
$repository->shouldReceive('setUser');
|
||||
$repository->shouldReceive('correctOrder');
|
||||
@ -350,10 +347,11 @@ class PiggyBankControllerTest extends TestCase
|
||||
public function testShow(): void
|
||||
{
|
||||
// mock stuff
|
||||
$first = $this->user()->transactionJournals()->inRandomOrder()->first();
|
||||
$repository = $this->mock(PiggyBankRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$repository->shouldReceive('setUser')->once();
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn($first);
|
||||
$repository->shouldReceive('getEvents')->andReturn(new Collection);
|
||||
$repository->shouldReceive('getSuggestedMonthlyAmount')->andReturn('1');
|
||||
$repository->shouldReceive('getCurrentAmount')->andReturn('1');
|
||||
|
@ -173,43 +173,6 @@ class ReportControllerTest extends TestCase
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Popup\ReportController::general
|
||||
* @covers \FireflyIII\Http\Controllers\Popup\ReportController::parseAttributes
|
||||
* @covers \FireflyIII\Http\Controllers\Popup\ReportController::balanceAmount
|
||||
*/
|
||||
public function testBalanceAmountDiffRole(): void
|
||||
{
|
||||
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
|
||||
$popupHelper = $this->mock(PopupReportInterface::class);
|
||||
|
||||
$budget = factory(Budget::class)->make();
|
||||
$account = factory(Account::class)->make();
|
||||
|
||||
$budgetRepos->shouldReceive('findNull')->andReturn($budget)->once()->withArgs([1]);
|
||||
$accountRepos->shouldReceive('findNull')->andReturn($account)->once()->withArgs([1]);
|
||||
$popupHelper->shouldReceive('balanceDifference')->once()->andReturn(new Collection);
|
||||
|
||||
$this->be($this->user());
|
||||
$arguments = [
|
||||
'attributes' => [
|
||||
'location' => 'balance-amount',
|
||||
'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
|
||||
'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
|
||||
'accounts' => 1,
|
||||
'accountId' => 1,
|
||||
'categoryId' => 1,
|
||||
'budgetId' => 1,
|
||||
'role' => 3, // diff role, is complicated.
|
||||
],
|
||||
];
|
||||
$uri = route('popup.general') . '?' . http_build_query($arguments);
|
||||
$response = $this->get($uri);
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Popup\ReportController::general
|
||||
* @covers \FireflyIII\Http\Controllers\Popup\ReportController::parseAttributes
|
||||
|
@ -25,7 +25,6 @@ namespace Tests\Feature\Controllers\Transaction;
|
||||
use Amount;
|
||||
use DB;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
@ -64,7 +63,15 @@ class ConvertControllerTest extends TestCase
|
||||
// mock stuff:
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn(new TransactionJournal);
|
||||
// find deposit:
|
||||
$loop = 0;
|
||||
do {
|
||||
$deposit = TransactionJournal::where('transaction_type_id', 2)->inRandomOrder()->where('user_id', $this->user()->id)->first();
|
||||
$count = $deposit->transactions()->count();
|
||||
$loop++;
|
||||
} while ($count !== 2 && $loop < 30);
|
||||
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn($deposit);
|
||||
$journalRepos->shouldReceive('getJournalTotal')->andReturn('1')->once();
|
||||
$journalRepos->shouldReceive('getJournalSourceAccounts')->andReturn(new Collection)->once();
|
||||
$journalRepos->shouldReceive('getJournalDestinationAccounts')->andReturn(new Collection)->once();
|
||||
@ -75,15 +82,12 @@ class ConvertControllerTest extends TestCase
|
||||
$this->mock(CurrencyRepositoryInterface::class);
|
||||
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$accountRepos->shouldReceive('getAccountsByType')
|
||||
->withArgs([[AccountType::ASSET, AccountType::DEFAULT]])->andReturn(new Collection([$account]))->once();
|
||||
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency)->times(3);
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency)->times(2);
|
||||
Amount::shouldReceive('formatAnything')->andReturn('0')->once();
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
|
||||
|
||||
$response = $this->get(route('transactions.convert.index', ['transfer', $deposit->id]));
|
||||
$response->assertStatus(200);
|
||||
$response->assertSee('Convert a deposit into a transfer');
|
||||
@ -96,7 +100,16 @@ class ConvertControllerTest extends TestCase
|
||||
{
|
||||
// mock stuff:
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn(new TransactionJournal);
|
||||
|
||||
// find deposit:
|
||||
$loop = 0;
|
||||
do {
|
||||
$deposit = TransactionJournal::where('transaction_type_id', 2)->inRandomOrder()->where('user_id', $this->user()->id)->first();
|
||||
$count = $deposit->transactions()->count();
|
||||
$loop++;
|
||||
} while ($count !== 2 && $loop < 30);
|
||||
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn($deposit);
|
||||
$journalRepos->shouldReceive('getJournalTotal')->andReturn('1')->once();
|
||||
$journalRepos->shouldReceive('getJournalSourceAccounts')->andReturn(new Collection)->once();
|
||||
$journalRepos->shouldReceive('getJournalDestinationAccounts')->andReturn(new Collection)->once();
|
||||
@ -107,7 +120,7 @@ class ConvertControllerTest extends TestCase
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency)->twice();
|
||||
Amount::shouldReceive('formatAnything')->andReturn('0')->once();
|
||||
|
||||
$deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('transactions.convert.index', ['withdrawal', $deposit->id]));
|
||||
$response->assertStatus(200);
|
||||
@ -120,12 +133,21 @@ class ConvertControllerTest extends TestCase
|
||||
public function testIndexSameType(): void
|
||||
{
|
||||
// mock stuff:
|
||||
|
||||
// find deposit:
|
||||
$loop = 0;
|
||||
do {
|
||||
$deposit = TransactionJournal::where('transaction_type_id', 2)->inRandomOrder()->where('user_id', $this->user()->id)->first();
|
||||
$count = $deposit->transactions()->count();
|
||||
$loop++;
|
||||
} while ($count !== 2 && $loop < 30);
|
||||
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn(new TransactionJournal);
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn($deposit);
|
||||
$journalRepos->shouldReceive('getJournalTotal')->andReturn('1')->once();
|
||||
|
||||
$this->be($this->user());
|
||||
$deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
|
||||
|
||||
$response = $this->get(route('transactions.convert.index', ['deposit', $deposit->id]));
|
||||
$response->assertStatus(302);
|
||||
$response->assertSessionHas('info');
|
||||
@ -166,14 +188,21 @@ class ConvertControllerTest extends TestCase
|
||||
public function testIndexTransferDeposit(): void
|
||||
{
|
||||
// mock stuff:
|
||||
|
||||
// find transfer:
|
||||
$loop = 0;
|
||||
do {
|
||||
$transfer = TransactionJournal::where('transaction_type_id', 3)->inRandomOrder()->where('user_id', $this->user()->id)->first();
|
||||
$count = $transfer->transactions()->count();
|
||||
$loop++;
|
||||
} while ($count !== 2 && $loop < 30);
|
||||
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn(new TransactionJournal);
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn($transfer);
|
||||
$journalRepos->shouldReceive('getJournalTotal')->andReturn('1')->once();
|
||||
$journalRepos->shouldReceive('getJournalSourceAccounts')->andReturn(new Collection)->once();
|
||||
$journalRepos->shouldReceive('getJournalDestinationAccounts')->andReturn(new Collection)->once();
|
||||
|
||||
|
||||
$transfer = TransactionJournal::where('transaction_type_id', 3)->where('user_id', $this->user()->id)->first();
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('transactions.convert.index', ['deposit', $transfer->id]));
|
||||
$response->assertStatus(200);
|
||||
@ -185,6 +214,14 @@ class ConvertControllerTest extends TestCase
|
||||
*/
|
||||
public function testIndexTransferWithdrawal(): void
|
||||
{
|
||||
// find transfer:
|
||||
$loop = 0;
|
||||
do {
|
||||
$transfer = TransactionJournal::where('transaction_type_id', 3)->inRandomOrder()->where('user_id', $this->user()->id)->first();
|
||||
$count = $transfer->transactions()->count();
|
||||
$loop++;
|
||||
} while ($count !== 2 && $loop < 30);
|
||||
|
||||
// mock stuff:
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn(new TransactionJournal);
|
||||
@ -197,7 +234,6 @@ class ConvertControllerTest extends TestCase
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency)->times(2);
|
||||
Amount::shouldReceive('formatAnything')->andReturn('0')->once();
|
||||
|
||||
$transfer = TransactionJournal::where('transaction_type_id', 3)->where('user_id', $this->user()->id)->first();
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('transactions.convert.index', ['withdrawal', $transfer->id]));
|
||||
$response->assertStatus(200);
|
||||
@ -209,6 +245,15 @@ class ConvertControllerTest extends TestCase
|
||||
*/
|
||||
public function testIndexWithdrawalDeposit(): void
|
||||
{
|
||||
|
||||
// find withdrawal:
|
||||
$loop = 0;
|
||||
do {
|
||||
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->inRandomOrder()->where('user_id', $this->user()->id)->first();
|
||||
$count = $withdrawal->transactions()->count();
|
||||
$loop++;
|
||||
} while ($count !== 2 && $loop < 30);
|
||||
|
||||
// mock stuff:
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn(new TransactionJournal);
|
||||
@ -221,7 +266,6 @@ class ConvertControllerTest extends TestCase
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency)->times(2);
|
||||
Amount::shouldReceive('formatAnything')->andReturn('0')->once();
|
||||
|
||||
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('transactions.convert.index', ['deposit', $withdrawal->id]));
|
||||
$response->assertStatus(200);
|
||||
@ -233,6 +277,14 @@ class ConvertControllerTest extends TestCase
|
||||
*/
|
||||
public function testIndexWithdrawalTransfer(): void
|
||||
{
|
||||
// find withdrawal:
|
||||
$loop = 0;
|
||||
do {
|
||||
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->inRandomOrder()->where('user_id', $this->user()->id)->first();
|
||||
$count = $withdrawal->transactions()->count();
|
||||
$loop++;
|
||||
} while ($count !== 2 && $loop < 30);
|
||||
|
||||
// mock stuff:
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn(new TransactionJournal);
|
||||
@ -242,17 +294,13 @@ class ConvertControllerTest extends TestCase
|
||||
|
||||
// mock stuff for new account list thing.
|
||||
$currency = TransactionCurrency::first();
|
||||
$account = factory(Account::class)->make();
|
||||
$this->mock(CurrencyRepositoryInterface::class);
|
||||
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$accountRepos->shouldReceive('getAccountsByType')
|
||||
->withArgs([[AccountType::ASSET, AccountType::DEFAULT]])->andReturn(new Collection([$account]))->once();
|
||||
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency)->times(3);
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency)->times(2);
|
||||
Amount::shouldReceive('formatAnything')->andReturn('0')->once();
|
||||
|
||||
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('transactions.convert.index', ['transfer', $withdrawal->id]));
|
||||
$response->assertStatus(200);
|
||||
@ -274,12 +322,6 @@ class ConvertControllerTest extends TestCase
|
||||
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$accountRepos->shouldReceive('find')->andReturn(new Account);
|
||||
$account = $this->user()->accounts()->first();
|
||||
$repository->shouldReceive('getJournalSourceAccounts')->andReturn(new Collection([$account]))->twice();
|
||||
$repository->shouldReceive('getJournalDestinationAccounts')->andReturn(new Collection([$account]))->twice();
|
||||
$accountRepos->shouldReceive('findNull')->andReturn($account)->once();
|
||||
|
||||
|
||||
$deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
|
||||
$data = ['source_account_asset' => 1];
|
||||
$this->be($this->user());
|
||||
@ -304,8 +346,6 @@ class ConvertControllerTest extends TestCase
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$accountRepos->shouldReceive('store')->andReturn(new Account);
|
||||
$account = $this->user()->accounts()->first();
|
||||
$repository->shouldReceive('getJournalSourceAccounts')->andReturn(new Collection([$account]))->twice();
|
||||
$repository->shouldReceive('getJournalDestinationAccounts')->andReturn(new Collection([$account]))->twice();
|
||||
|
||||
$deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
|
||||
$data = ['destination_account_expense' => 'New expense name.'];
|
||||
@ -328,15 +368,8 @@ class ConvertControllerTest extends TestCase
|
||||
$repository->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$accountRepos->shouldReceive('getCashAccount')->andReturn(new Account)->once();
|
||||
|
||||
$account = $this->user()->accounts()->first();
|
||||
$repository->shouldReceive('getJournalSourceAccounts')->andReturn(new Collection([$account]))->twice();
|
||||
$repository->shouldReceive('getJournalDestinationAccounts')->andReturn(new Collection([$account]))->twice();
|
||||
|
||||
|
||||
$deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
|
||||
$data = ['destination_account_expense' => ''];
|
||||
$deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
|
||||
$data = ['destination_account_expense' => ''];
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('transactions.convert.index', ['withdrawal', $deposit->id]), $data);
|
||||
$response->assertStatus(302);
|
||||
@ -353,6 +386,14 @@ class ConvertControllerTest extends TestCase
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$account = $this->user()->accounts()->first();
|
||||
|
||||
// find withdrawal:
|
||||
$loop = 0;
|
||||
do {
|
||||
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->inRandomOrder()->where('user_id', $this->user()->id)->first();
|
||||
$count = $withdrawal->transactions()->count();
|
||||
$loop++;
|
||||
} while ($count !== 2 && $loop < 30);
|
||||
|
||||
|
||||
// mock stuff
|
||||
$messageBag = new MessageBag;
|
||||
@ -364,10 +405,7 @@ class ConvertControllerTest extends TestCase
|
||||
$repository->shouldReceive('getJournalSourceAccounts')->andReturn(new Collection([$account]))->twice();
|
||||
$repository->shouldReceive('getJournalDestinationAccounts')->andReturn(new Collection([$account]))->twice();
|
||||
$accountRepos->shouldReceive('findNull')->andReturn($account)->once();
|
||||
|
||||
|
||||
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
|
||||
$data = [
|
||||
$data = [
|
||||
'destination_account_asset' => 2,
|
||||
];
|
||||
$this->be($this->user());
|
||||
@ -434,6 +472,14 @@ class ConvertControllerTest extends TestCase
|
||||
*/
|
||||
public function testPostIndexTransferDeposit(): void
|
||||
{
|
||||
// find transfer:
|
||||
$loop = 0;
|
||||
do {
|
||||
$transfer = TransactionJournal::where('transaction_type_id', 3)->inRandomOrder()->where('user_id', $this->user()->id)->first();
|
||||
$count = $transfer->transactions()->count();
|
||||
$loop++;
|
||||
} while ($count !== 2 && $loop < 30);
|
||||
|
||||
// mock stuff
|
||||
$repository = $this->mock(JournalRepositoryInterface::class);
|
||||
$repository->shouldReceive('convert')->andReturn(new MessageBag);
|
||||
@ -446,8 +492,7 @@ class ConvertControllerTest extends TestCase
|
||||
$repository->shouldReceive('getJournalSourceAccounts')->andReturn(new Collection([$account]))->twice();
|
||||
$repository->shouldReceive('getJournalDestinationAccounts')->andReturn(new Collection([$account]))->twice();
|
||||
|
||||
$transfer = TransactionJournal::where('transaction_type_id', 3)->where('user_id', $this->user()->id)->first();
|
||||
$data = ['source_account_revenue' => 'New rev'];
|
||||
$data = ['source_account_revenue' => 'New rev'];
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('transactions.convert.index', ['deposit', $transfer->id]), $data);
|
||||
$response->assertStatus(302);
|
||||
@ -466,13 +511,6 @@ class ConvertControllerTest extends TestCase
|
||||
$repository->shouldReceive('convert')->andReturn(new MessageBag);
|
||||
$repository->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$accountRepos->shouldReceive('store')->andReturn(new Account)->once();
|
||||
|
||||
$account = $this->user()->accounts()->first();
|
||||
$repository->shouldReceive('getJournalSourceAccounts')->andReturn(new Collection([$account]))->twice();
|
||||
$repository->shouldReceive('getJournalDestinationAccounts')->andReturn(new Collection([$account]))->twice();
|
||||
|
||||
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
|
||||
$data = ['source_account_revenue' => 'New revenue name.'];
|
||||
$this->be($this->user());
|
||||
@ -493,13 +531,6 @@ class ConvertControllerTest extends TestCase
|
||||
$repository->shouldReceive('convert')->andReturn(new MessageBag);
|
||||
$repository->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$accountRepos->shouldReceive('getCashAccount')->andReturn(new Account)->once();
|
||||
|
||||
$account = $this->user()->accounts()->first();
|
||||
$repository->shouldReceive('getJournalSourceAccounts')->andReturn(new Collection([$account]))->twice();
|
||||
$repository->shouldReceive('getJournalDestinationAccounts')->andReturn(new Collection([$account]))->twice();
|
||||
|
||||
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
|
||||
$data = ['source_account_revenue' => ''];
|
||||
$this->be($this->user());
|
||||
@ -523,10 +554,6 @@ class ConvertControllerTest extends TestCase
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$accountRepos->shouldReceive('findNull')->andReturn(new Account);
|
||||
|
||||
$account = $this->user()->accounts()->first();
|
||||
$repository->shouldReceive('getJournalSourceAccounts')->andReturn(new Collection([$account]))->twice();
|
||||
$repository->shouldReceive('getJournalDestinationAccounts')->andReturn(new Collection([$account]))->twice();
|
||||
|
||||
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
|
||||
$data = ['destination_account_asset' => 2,];
|
||||
$this->be($this->user());
|
||||
|
@ -33,7 +33,6 @@ use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
@ -352,7 +351,7 @@ class SingleControllerTest extends TestCase
|
||||
$response->assertStatus(200);
|
||||
// has bread crumb
|
||||
$response->assertSee('<ol class="breadcrumb">');
|
||||
$response->assertSee(' name="destinationt_name" type="text" value="">');
|
||||
$response->assertSee(' name="destination_name" type="text" value="">');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -592,8 +591,8 @@ class SingleControllerTest extends TestCase
|
||||
'what' => 'withdrawal',
|
||||
'amount' => '10',
|
||||
'amount_currency_id_amount' => 1,
|
||||
'source_id' => 1,
|
||||
'destination_name' => 'Some destination',
|
||||
'source_id' => 1,
|
||||
'destination_name' => 'Some destination',
|
||||
'date' => '2016-01-01',
|
||||
'description' => 'Test descr',
|
||||
];
|
||||
@ -645,8 +644,8 @@ class SingleControllerTest extends TestCase
|
||||
'what' => 'withdrawal',
|
||||
'amount' => '10',
|
||||
'amount_currency_id_amount' => 1,
|
||||
'source_id' => 1,
|
||||
'destination_name' => 'Some destination',
|
||||
'source_id' => 1,
|
||||
'destination_name' => 'Some destination',
|
||||
'date' => '2016-01-01',
|
||||
'description' => 'Test descr',
|
||||
];
|
||||
@ -700,8 +699,8 @@ class SingleControllerTest extends TestCase
|
||||
'what' => 'deposit',
|
||||
'amount' => '10',
|
||||
'amount_currency_id_amount' => 1,
|
||||
'destination_id' => 1,
|
||||
'source_name' => 'Some source',
|
||||
'destination_id' => 1,
|
||||
'source_name' => 'Some source',
|
||||
'date' => '2016-01-01',
|
||||
'description' => 'Test descr',
|
||||
];
|
||||
@ -756,8 +755,8 @@ class SingleControllerTest extends TestCase
|
||||
'what' => 'transfer',
|
||||
'amount' => '10',
|
||||
'amount_currency_id_amount' => 1,
|
||||
'destination_id' => 1,
|
||||
'source_id' => 2,
|
||||
'destination_id' => 1,
|
||||
'source_id' => 2,
|
||||
'date' => '2016-01-01',
|
||||
'description' => 'Test descr',
|
||||
];
|
||||
@ -814,8 +813,8 @@ class SingleControllerTest extends TestCase
|
||||
'amount_currency_id_amount' => 1,
|
||||
'source_account_currency' => 1,
|
||||
'destination_account_currency' => 2,
|
||||
'destination_id' => 1,
|
||||
'source_id' => 2,
|
||||
'destination_id' => 1,
|
||||
'source_id' => 2,
|
||||
'date' => '2016-01-01',
|
||||
'description' => 'Test descr',
|
||||
];
|
||||
@ -858,13 +857,15 @@ class SingleControllerTest extends TestCase
|
||||
$this->assertTrue(false, $e->getMessage());
|
||||
}
|
||||
|
||||
$journal = new TransactionJournal();
|
||||
$type = TransactionType::find(1);
|
||||
$journal->id = 1000;
|
||||
$journal->description = 'New journal';
|
||||
$journal->transactionType()->associate($type);
|
||||
// find withdrawal:
|
||||
$loop = 0;
|
||||
do {
|
||||
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->inRandomOrder()->where('user_id', $this->user()->id)->first();
|
||||
$count = $withdrawal->transactions()->count();
|
||||
$loop++;
|
||||
} while ($count !== 2 && $loop < 30);
|
||||
|
||||
$journalRepos->shouldReceive('update')->andReturn($journal);
|
||||
$journalRepos->shouldReceive('update')->andReturn($withdrawal);
|
||||
|
||||
$this->session(['transactions.edit.uri' => 'http://localhost']);
|
||||
$this->be($this->user());
|
||||
@ -872,8 +873,8 @@ class SingleControllerTest extends TestCase
|
||||
'id' => 123,
|
||||
'what' => 'withdrawal',
|
||||
'description' => 'Updated groceries',
|
||||
'source_id' => 1,
|
||||
'destination_name' => 'PLUS',
|
||||
'source_id' => 1,
|
||||
'destination_name' => 'PLUS',
|
||||
'amount' => '123',
|
||||
'amount_currency_id_amount' => 1,
|
||||
'budget_id' => 1,
|
||||
@ -882,13 +883,13 @@ class SingleControllerTest extends TestCase
|
||||
'date' => '2016-01-01',
|
||||
];
|
||||
|
||||
$response = $this->post(route('transactions.update', [123]), $data);
|
||||
$response = $this->post(route('transactions.update', [$withdrawal->id]), $data);
|
||||
$response->assertStatus(302);
|
||||
$response->assertSessionHas('success');
|
||||
|
||||
$response = $this->get(route('transactions.show', [123]));
|
||||
$response = $this->get(route('transactions.show', [$withdrawal->id]));
|
||||
$response->assertStatus(200);
|
||||
$response->assertSee('Updated groceries');
|
||||
$response->assertSee($withdrawal->description);
|
||||
// has bread crumb
|
||||
$response->assertSee('<ol class="breadcrumb">');
|
||||
}
|
||||
|
@ -696,7 +696,7 @@ class TransactionFactoryTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* Create transfer using minimal data.
|
||||
* Create reconciliation using minimal data.
|
||||
*
|
||||
* @covers \FireflyIII\Factory\TransactionFactory
|
||||
* @covers \FireflyIII\Services\Internal\Support\TransactionServiceTrait
|
||||
|
@ -46,7 +46,7 @@ class SpectreRoutineTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'SRA' . random_int(1, 1000);
|
||||
$job->key = 'SR1A' . random_int(1, 1000);
|
||||
$job->status = 'ready_to_run';
|
||||
$job->stage = 'do-authenticate';
|
||||
$job->provider = 'spectre';
|
||||
@ -77,7 +77,7 @@ class SpectreRoutineTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'SRA' . random_int(1, 1000);
|
||||
$job->key = 'SR2b' . random_int(1, 1000);
|
||||
$job->status = 'ready_to_run';
|
||||
$job->stage = 'authenticated';
|
||||
$job->provider = 'spectre';
|
||||
@ -115,7 +115,7 @@ class SpectreRoutineTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'SRA' . random_int(1, 1000);
|
||||
$job->key = 'SR3c' . random_int(1, 1000);
|
||||
$job->status = 'ready_to_run';
|
||||
$job->stage = 'go-for-import';
|
||||
$job->provider = 'spectre';
|
||||
@ -154,7 +154,7 @@ class SpectreRoutineTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'SRA' . random_int(1, 1000);
|
||||
$job->key = 'SR4A' . random_int(1, 1000);
|
||||
$job->status = 'ready_to_run';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'spectre';
|
||||
@ -194,7 +194,7 @@ class SpectreRoutineTest extends TestCase
|
||||
{
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'SRA' . random_int(1, 1000);
|
||||
$job->key = 'SR5A' . random_int(1, 1000);
|
||||
$job->status = 'ready_to_run';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'spectre';
|
||||
|
@ -76,6 +76,7 @@ class SandstormTest extends TestCase
|
||||
|
||||
$repository = $this->mock(UserRepositoryInterface::class);
|
||||
$repository->shouldReceive('count')->twice()->andReturn(1);
|
||||
$repository->shouldReceive('hasRole')->andReturn(true);
|
||||
|
||||
$response = $this->get('/_test/sandstorm');
|
||||
$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
|
||||
@ -128,6 +129,7 @@ class SandstormTest extends TestCase
|
||||
$repository->shouldReceive('store')->once()->andReturn($this->user());
|
||||
$repository->shouldReceive('attachRole')->twice()->andReturn(true);
|
||||
$repository->shouldReceive('getRole')->once()->andReturn(new Role);
|
||||
$repository->shouldReceive('hasRole')->andReturn(false);
|
||||
|
||||
$response = $this->get('/_test/sandstorm', ['X-Sandstorm-User-Id' => 'abcd']);
|
||||
$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
|
||||
@ -156,6 +158,7 @@ class SandstormTest extends TestCase
|
||||
$repository = $this->mock(UserRepositoryInterface::class);
|
||||
$repository->shouldReceive('count')->twice()->andReturn(1);
|
||||
$repository->shouldReceive('first')->once()->andReturn($this->user());
|
||||
$repository->shouldReceive('hasRole')->andReturn(true);
|
||||
|
||||
$response = $this->get('/_test/sandstorm', ['X-Sandstorm-User-Id' => 'abcd']);
|
||||
$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
|
||||
|
@ -127,12 +127,14 @@ class ChooseAccountsHandlerTest extends TestCase
|
||||
'account_mapping' => [
|
||||
'1234' => '456',
|
||||
],
|
||||
'apply_rules' => true,
|
||||
];
|
||||
|
||||
$config = [
|
||||
'accounts' => [
|
||||
'accounts' => [
|
||||
0 => ['id' => 1234, 'name' => 'bunq'],
|
||||
],
|
||||
'apply-rules' => true,
|
||||
];
|
||||
$expected = $config;
|
||||
$expected['mapping'][1234] = 456;
|
||||
@ -179,12 +181,14 @@ class ChooseAccountsHandlerTest extends TestCase
|
||||
'account_mapping' => [
|
||||
'1234' => '456',
|
||||
],
|
||||
'apply_rules' => true,
|
||||
];
|
||||
|
||||
$config = [
|
||||
'accounts' => [
|
||||
'accounts' => [
|
||||
0 => ['id' => 1235, 'name' => 'bunq'],
|
||||
],
|
||||
'apply-rules' => true,
|
||||
];
|
||||
$expected = $config;
|
||||
$expected['mapping'][0] = 456;
|
||||
@ -231,12 +235,14 @@ class ChooseAccountsHandlerTest extends TestCase
|
||||
'account_mapping' => [
|
||||
'1234' => '456',
|
||||
],
|
||||
'apply_rules' => true,
|
||||
];
|
||||
|
||||
$config = [
|
||||
'accounts' => [
|
||||
'accounts' => [
|
||||
0 => ['id' => 1234, 'name' => 'bunq'],
|
||||
],
|
||||
'apply-rules' => true,
|
||||
];
|
||||
$expected = $config;
|
||||
$expected['mapping'][1234] = 0;
|
||||
@ -279,11 +285,13 @@ class ChooseAccountsHandlerTest extends TestCase
|
||||
$job->save();
|
||||
|
||||
// data:
|
||||
$data = ['account_mapping' => []];
|
||||
$data = ['account_mapping' => [], 'apply_rules' => true,];
|
||||
$config = [
|
||||
'accounts' => [
|
||||
0 => ['id' => 1234, 'name' => 'bunq'],
|
||||
],
|
||||
'apply-rules' => true,
|
||||
|
||||
];
|
||||
|
||||
// mock stuff
|
||||
|
@ -48,16 +48,14 @@ class NewBunqJobHandlerTest extends TestCase
|
||||
$job->save();
|
||||
|
||||
// expected config:
|
||||
$expected = [
|
||||
'apply-rules' => true,
|
||||
];
|
||||
//$expected = [];
|
||||
|
||||
// mock stuff
|
||||
$repository = $this->mock(ImportJobRepositoryInterface::class);
|
||||
// mock calls
|
||||
$repository->shouldReceive('setUser')->once();
|
||||
$repository->shouldReceive('getConfiguration')->andReturn([])->once();
|
||||
$repository->shouldReceive('setConfiguration')->withArgs([Mockery::any(), $expected])->once();
|
||||
//$repository->shouldReceive('getConfiguration')->andReturn([])->once();
|
||||
//$repository->shouldReceive('setConfiguration')->withArgs([Mockery::any(), $expected])->once();
|
||||
|
||||
$handler = new NewBunqJobHandler();
|
||||
$handler->setImportJob($job);
|
||||
|
@ -148,11 +148,13 @@ class ChooseAccountsHandlerTest extends TestCase
|
||||
// data to submit:
|
||||
$data = [
|
||||
'account_mapping' => [3131 => 872,],
|
||||
'apply_rules' => true,
|
||||
];
|
||||
// expected configuration:
|
||||
$config = [
|
||||
'accounts' => [0 => ['id' => 3131, 'name' => 'Some fake account',],],
|
||||
'account_mapping' => [3131 => 872,],
|
||||
'apply-rules' => true,
|
||||
];
|
||||
|
||||
|
||||
@ -175,6 +177,65 @@ class ChooseAccountsHandlerTest extends TestCase
|
||||
$this->assertCount(0, $handler->configureJob($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* Case: Local account is invalid. Spectre account is invalid.
|
||||
*
|
||||
* @covers \FireflyIII\Support\Import\JobConfiguration\Spectre\ChooseAccountsHandler
|
||||
*/
|
||||
public function testConfigureJobInvalidBoth(): void
|
||||
{
|
||||
// fake job:
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'sca-E' . random_int(1, 1000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'spectre';
|
||||
$job->file_type = '';
|
||||
$job->configuration = [
|
||||
'accounts' => [
|
||||
0 => [
|
||||
'id' => 3134,
|
||||
'name' => 'Some fake account',
|
||||
],
|
||||
],
|
||||
];
|
||||
$job->save();
|
||||
|
||||
// data to submit:
|
||||
$data = [
|
||||
'account_mapping' => [3131 => 872,],
|
||||
'apply_rules' => true,
|
||||
];
|
||||
// expected configuration:
|
||||
$config = [
|
||||
'accounts' => [0 => ['id' => 3134, 'name' => 'Some fake account',],],
|
||||
'account_mapping' => [0 => 0,],
|
||||
'apply-rules' => true,
|
||||
];
|
||||
|
||||
|
||||
// mock repositories:
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$importRepos = $this->mock(ImportJobRepositoryInterface::class);
|
||||
|
||||
// mock calls:
|
||||
$accountRepos->shouldReceive('setUser')->once();
|
||||
$currencyRepos->shouldReceive('setUser')->once();
|
||||
$importRepos->shouldReceive('setUser')->once();
|
||||
$accountRepos->shouldReceive('findNull')->once()->withArgs([872])->andReturn(null);
|
||||
$importRepos->shouldReceive('setConfiguration')->once()->withArgs([Mockery::any(), $config]);
|
||||
|
||||
|
||||
// call handler:
|
||||
$handler = new ChooseAccountsHandler();
|
||||
$handler->setImportJob($job);
|
||||
$result = $handler->configureJob($data);
|
||||
$this->assertCount(1, $result);
|
||||
$this->assertEquals('It seems you have not selected any accounts to import from.', $result->first());
|
||||
}
|
||||
|
||||
/**
|
||||
* Case: Local account is invalid. Spectre account is valid.
|
||||
*
|
||||
@ -203,11 +264,13 @@ class ChooseAccountsHandlerTest extends TestCase
|
||||
// data to submit:
|
||||
$data = [
|
||||
'account_mapping' => [3131 => 872,],
|
||||
'apply_rules' => true,
|
||||
];
|
||||
// expected configuration:
|
||||
$config = [
|
||||
'accounts' => [0 => ['id' => 3131, 'name' => 'Some fake account',],],
|
||||
'account_mapping' => [3131 => 0,],
|
||||
'apply-rules' => true,
|
||||
];
|
||||
|
||||
|
||||
@ -260,11 +323,13 @@ class ChooseAccountsHandlerTest extends TestCase
|
||||
// data to submit:
|
||||
$data = [
|
||||
'account_mapping' => [3131 => 872,],
|
||||
'apply_rules' => true,
|
||||
];
|
||||
// expected configuration:
|
||||
$config = [
|
||||
'accounts' => [0 => ['id' => 3134, 'name' => 'Some fake account',],],
|
||||
'account_mapping' => [0 => 872,],
|
||||
'apply-rules' => true,
|
||||
];
|
||||
|
||||
|
||||
@ -287,64 +352,6 @@ class ChooseAccountsHandlerTest extends TestCase
|
||||
$this->assertCount(0, $handler->configureJob($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* Case: Local account is invalid. Spectre account is invalid.
|
||||
*
|
||||
* @covers \FireflyIII\Support\Import\JobConfiguration\Spectre\ChooseAccountsHandler
|
||||
*/
|
||||
public function testConfigureJobInvalidBoth(): void
|
||||
{
|
||||
// fake job:
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
$job->key = 'sca-E' . random_int(1, 1000);
|
||||
$job->status = 'new';
|
||||
$job->stage = 'new';
|
||||
$job->provider = 'spectre';
|
||||
$job->file_type = '';
|
||||
$job->configuration = [
|
||||
'accounts' => [
|
||||
0 => [
|
||||
'id' => 3134,
|
||||
'name' => 'Some fake account',
|
||||
],
|
||||
],
|
||||
];
|
||||
$job->save();
|
||||
|
||||
// data to submit:
|
||||
$data = [
|
||||
'account_mapping' => [3131 => 872,],
|
||||
];
|
||||
// expected configuration:
|
||||
$config = [
|
||||
'accounts' => [0 => ['id' => 3134, 'name' => 'Some fake account',],],
|
||||
'account_mapping' => [0 => 0,],
|
||||
];
|
||||
|
||||
|
||||
// mock repositories:
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$importRepos = $this->mock(ImportJobRepositoryInterface::class);
|
||||
|
||||
// mock calls:
|
||||
$accountRepos->shouldReceive('setUser')->once();
|
||||
$currencyRepos->shouldReceive('setUser')->once();
|
||||
$importRepos->shouldReceive('setUser')->once();
|
||||
$accountRepos->shouldReceive('findNull')->once()->withArgs([872])->andReturn(null);
|
||||
$importRepos->shouldReceive('setConfiguration')->once()->withArgs([Mockery::any(), $config]);
|
||||
|
||||
|
||||
// call handler:
|
||||
$handler = new ChooseAccountsHandler();
|
||||
$handler->setImportJob($job);
|
||||
$result =$handler->configureJob($data);
|
||||
$this->assertCount(1, $result);
|
||||
$this->assertEquals('It seems you have not selected any accounts to import from.', $result->first());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Support\Import\JobConfiguration\Spectre\ChooseAccountsHandler
|
||||
*/
|
||||
|
@ -61,8 +61,7 @@ class CurrencyMapperTest extends TestCase
|
||||
$repository = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$repository->shouldReceive('setUser')->once();
|
||||
$repository->shouldReceive('findNull')->once()->withArgs([$currency->id])->andReturn(null);
|
||||
$repository->shouldReceive('store')->once()
|
||||
->withArgs([['code' => null, 'name' => null, 'symbol' => null, 'decimal_places' => 2]])->andReturn(null);
|
||||
|
||||
$mapper = new CurrencyMapper();
|
||||
$mapper->setUser($this->user());
|
||||
|
||||
@ -161,9 +160,6 @@ class CurrencyMapperTest extends TestCase
|
||||
// mock data
|
||||
$repository = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$repository->shouldReceive('setUser')->once();
|
||||
$repository->shouldReceive('store')->once()
|
||||
->withArgs([['code' => null, 'name' => null, 'symbol' => null, 'decimal_places' => 2]])->andReturn(null);
|
||||
|
||||
|
||||
$mapper = new CurrencyMapper();
|
||||
$mapper->setUser($this->user());
|
||||
|
@ -148,6 +148,7 @@ class ImportableConverterTest extends TestCase
|
||||
$opposingMapper->shouldReceive('map')->once()->withArgs([null, '45.67', $nullAccount])->andReturn($other);
|
||||
$currencyMapper->shouldReceive('map')->once()->withArgs([null, ['name' => null, 'code' => null, 'symbol' => null]])->andReturn(null);
|
||||
$currencyMapper->shouldReceive('map')->once()->withArgs([null, ['code' => null]])->andReturn(null);
|
||||
$currencyMapper->shouldReceive('map')->times(2)->withArgs([$euro->id, []])->andReturn($euro);
|
||||
|
||||
|
||||
$converter = new ImportableConverter;
|
||||
@ -173,7 +174,7 @@ class ImportableConverterTest extends TestCase
|
||||
$importable = new ImportTransaction;
|
||||
$importable->amount = '45.67';
|
||||
$importable->date = '20180917';
|
||||
$importable->meta['date-book'] = '2018-01-02';
|
||||
$importable->meta['date-book'] = '20180102';
|
||||
$importables = [$importable];
|
||||
|
||||
$job = $this->user()->importJobs()->first();
|
||||
@ -221,7 +222,7 @@ class ImportableConverterTest extends TestCase
|
||||
$this->assertEquals($usd->id, $result[0]['transactions'][0]['currency_id']);
|
||||
$this->assertEquals($revenue->id, $result[0]['transactions'][0]['source_id']);
|
||||
$this->assertEquals($asset->id, $result[0]['transactions'][0]['destination_id']);
|
||||
$this->assertEquals($importable->meta['date-book'], $result[0]['book_date']);
|
||||
$this->assertEquals('2018-01-02', $result[0]['book_date']);
|
||||
|
||||
}
|
||||
|
||||
@ -291,8 +292,8 @@ class ImportableConverterTest extends TestCase
|
||||
$importable = new ImportTransaction;
|
||||
$importable->amount = '45.67';
|
||||
$importable->date = '20180917';
|
||||
$importable->billId = 2; // will be ignored because it's not valid.
|
||||
$importable->billName = 'Some Bill'; // will be included because bill ID is not valid.
|
||||
$importable->billId = 2; // will NOT be ignored despite it's not valid.
|
||||
$importable->billName = 'Some Bill'; // will always be included even when bill ID is not valid.
|
||||
$importables = [$importable];
|
||||
|
||||
$job = $this->user()->importJobs()->first();
|
||||
@ -337,7 +338,7 @@ class ImportableConverterTest extends TestCase
|
||||
$this->assertEquals('transfer', $result[0]['type']);
|
||||
$this->assertEquals('2018-09-17', $result[0]['date']);
|
||||
$this->assertEquals([], $result[0]['tags']);
|
||||
$this->assertNull($result[0]['bill_id']);
|
||||
$this->assertEquals(2, $result[0]['bill_id']); // will NOT be ignored.
|
||||
$this->assertEquals($importable->billName, $result[0]['bill_name']);
|
||||
$this->assertEquals($usd->id, $result[0]['transactions'][0]['currency_id']);
|
||||
// since amount is positive, $asset recieves the money
|
||||
@ -357,7 +358,7 @@ class ImportableConverterTest extends TestCase
|
||||
$importable->amount = '-45.67';
|
||||
$importable->date = '20180917';
|
||||
$importable->billId = 3; // is added to array of valid values, see below.
|
||||
$importable->billName = 'Some bill'; // will be ignored because ID is valid.
|
||||
$importable->billName = 'Some bill'; // will be added even when ID is valid.
|
||||
$importables = [$importable];
|
||||
|
||||
$validMappings = [
|
||||
@ -408,7 +409,7 @@ class ImportableConverterTest extends TestCase
|
||||
$this->assertEquals('2018-09-17', $result[0]['date']);
|
||||
$this->assertEquals([], $result[0]['tags']);
|
||||
$this->assertEquals(3, $result[0]['bill_id']);
|
||||
$this->assertNull($result[0]['bill_name']);
|
||||
$this->assertEquals($importable->billName, $result[0]['bill_name']);
|
||||
$this->assertEquals($usd->id, $result[0]['transactions'][0]['currency_id']);
|
||||
// since amount is negative, $asset sends the money
|
||||
$this->assertEquals($asset->id, $result[0]['transactions'][0]['source_id']);
|
||||
|
@ -97,6 +97,7 @@ class StageNewHandlerTest extends TestCase
|
||||
// create new customer:
|
||||
$ncRequest->shouldReceive('setUser')->once();
|
||||
$ncRequest->shouldReceive('getCustomer')->once()->andReturn($fakeCustomer);
|
||||
$ncRequest->shouldReceive('call')->once();
|
||||
|
||||
// mock calls for repository:
|
||||
$repository->shouldReceive('setUser')->once();
|
||||
|
@ -36,7 +36,11 @@ class CategoryIsTest extends TestCase
|
||||
*/
|
||||
public function testTriggeredJournal(): void
|
||||
{
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
do {
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$transactions = $journal->transactions()->count();
|
||||
} while ($transactions === 0);
|
||||
|
||||
$category = $journal->user->categories()->first();
|
||||
$journal->categories()->detach();
|
||||
$journal->categories()->save($category);
|
||||
@ -52,7 +56,11 @@ class CategoryIsTest extends TestCase
|
||||
*/
|
||||
public function testTriggeredNotJournal(): void
|
||||
{
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
do {
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$transactions = $journal->transactions()->count();
|
||||
} while ($transactions === 0);
|
||||
|
||||
$category = $journal->user->categories()->first();
|
||||
$otherCategory = $journal->user->categories()->where('id', '!=', $category->id)->first();
|
||||
$journal->categories()->detach();
|
||||
@ -69,7 +77,11 @@ class CategoryIsTest extends TestCase
|
||||
*/
|
||||
public function testTriggeredTransaction(): void
|
||||
{
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
do {
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$transactions = $journal->transactions()->count();
|
||||
} while ($transactions === 0);
|
||||
|
||||
$transaction = $journal->transactions()->first();
|
||||
$category = $journal->user->categories()->first();
|
||||
|
||||
|
@ -36,9 +36,13 @@ class ToAccountIsTest extends TestCase
|
||||
*/
|
||||
public function testTriggered(): void
|
||||
{
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||
$account = $transaction->account;
|
||||
$count = 0;
|
||||
do {
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||
$account = $transaction->account;
|
||||
$count++;
|
||||
} while ($account === null && $count < 30);
|
||||
|
||||
$trigger = ToAccountIs::makeFromStrings($account->name, false);
|
||||
$result = $trigger->triggered($journal);
|
||||
@ -50,7 +54,13 @@ class ToAccountIsTest extends TestCase
|
||||
*/
|
||||
public function testTriggeredNot(): void
|
||||
{
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$count = 0;
|
||||
do {
|
||||
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||
$account = $transaction->account;
|
||||
$count++;
|
||||
} while ($account === null && $count < 30);
|
||||
|
||||
$trigger = ToAccountIs::makeFromStrings('some name' . random_int(1, 234), false);
|
||||
$result = $trigger->triggered($journal);
|
||||
|
@ -68,44 +68,6 @@ class BillTransformerTest extends TestCase
|
||||
$this->assertTrue($result['active']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Basic coverage with a note.
|
||||
*
|
||||
* @covers \FireflyIII\Transformers\BillTransformer::transform
|
||||
*/
|
||||
public function testNote(): void
|
||||
{
|
||||
|
||||
$bill = Bill::create(
|
||||
[
|
||||
'user_id' => $this->user()->id,
|
||||
'name' => 'Some bill ' . random_int(1, 10000),
|
||||
'match' => 'word,' . random_int(1, 10000),
|
||||
'amount_min' => 12.34,
|
||||
'amount_max' => 45.67,
|
||||
'date' => '2018-01-02',
|
||||
'transaction_currency_id' => 1,
|
||||
'repeat_freq' => 'weekly',
|
||||
'skip' => 0,
|
||||
'active' => 1,
|
||||
]
|
||||
);
|
||||
$noteText = 'I are a note ' . random_int(1, 10000);
|
||||
Note::create(
|
||||
[
|
||||
'noteable_id' => $bill->id,
|
||||
'noteable_type' => Bill::class,
|
||||
'text' => $noteText,
|
||||
]
|
||||
);
|
||||
$transformer = new BillTransformer(new ParameterBag);
|
||||
$result = $transformer->transform($bill);
|
||||
|
||||
$this->assertEquals($bill->name, $result['name']);
|
||||
$this->assertEquals($noteText, $result['notes']);
|
||||
$this->assertTrue($result['active']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Coverage for dates.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user