diff --git a/app/Console/Commands/CreateImport.php b/app/Console/Commands/CreateImport.php
index 41fd83d762..00ff5094c6 100644
--- a/app/Console/Commands/CreateImport.php
+++ b/app/Console/Commands/CreateImport.php
@@ -79,7 +79,8 @@ class CreateImport extends Command
$this->info(sprintf('Type of import: %s', $type));
/** @var ImportJobRepositoryInterface $jobRepository */
- $jobRepository = app(ImportJobRepositoryInterface::class, [$user]);
+ $jobRepository = app(ImportJobRepositoryInterface::class);
+ $jobRepository->setUser($user);
$job = $jobRepository->create($type);
$this->line(sprintf('Created job "%s"...', $job->key));
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
index 8ea0f88014..f4a1e32559 100644
--- a/app/Console/Kernel.php
+++ b/app/Console/Kernel.php
@@ -39,9 +39,9 @@ class Kernel extends ConsoleKernel
*/
protected $bootstrappers
= [
- 'Illuminate\Foundation\Bootstrap\DetectEnvironment',
+ 'Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables',
'Illuminate\Foundation\Bootstrap\LoadConfiguration',
- 'FireflyIII\Bootstrap\ConfigureLogging',
+ //'FireflyIII\Bootstrap\ConfigureLogging',
'Illuminate\Foundation\Bootstrap\HandleExceptions',
'Illuminate\Foundation\Bootstrap\RegisterFacades',
'Illuminate\Foundation\Bootstrap\SetRequestForConsole',
diff --git a/app/Export/Collector/AttachmentCollector.php b/app/Export/Collector/AttachmentCollector.php
index e068f32585..810dc1db85 100644
--- a/app/Export/Collector/AttachmentCollector.php
+++ b/app/Export/Collector/AttachmentCollector.php
@@ -43,10 +43,8 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
/**
* AttachmentCollector constructor.
- *
- * @param ExportJob $job
*/
- public function __construct(ExportJob $job)
+ public function __construct()
{
/** @var AttachmentRepositoryInterface repository */
$this->repository = app(AttachmentRepositoryInterface::class);
@@ -54,7 +52,7 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
$this->uploadDisk = Storage::disk('upload');
$this->exportDisk = Storage::disk('export');
- parent::__construct($job);
+ parent::__construct();
}
/**
diff --git a/app/Export/Collector/BasicCollector.php b/app/Export/Collector/BasicCollector.php
index 4fd571c84d..c80e8ec280 100644
--- a/app/Export/Collector/BasicCollector.php
+++ b/app/Export/Collector/BasicCollector.php
@@ -31,13 +31,10 @@ class BasicCollector
/**
* BasicCollector constructor.
- *
- * @param ExportJob $job
*/
- public function __construct(ExportJob $job)
+ public function __construct()
{
$this->entries = new Collection;
- $this->job = $job;
}
/**
@@ -56,5 +53,13 @@ class BasicCollector
$this->entries = $entries;
}
+ /**
+ * @param ExportJob $job
+ */
+ public function setJob(ExportJob $job)
+ {
+ $this->job = $job;
+ }
+
}
diff --git a/app/Export/Collector/CollectorInterface.php b/app/Export/Collector/CollectorInterface.php
index f1778e9adc..54a3fa88a1 100644
--- a/app/Export/Collector/CollectorInterface.php
+++ b/app/Export/Collector/CollectorInterface.php
@@ -13,6 +13,7 @@ declare(strict_types = 1);
namespace FireflyIII\Export\Collector;
+use FireflyIII\Models\ExportJob;
use Illuminate\Support\Collection;
/**
@@ -32,6 +33,13 @@ interface CollectorInterface
*/
public function run(): bool;
+ /**
+ * @param ExportJob $job
+ *
+ * @return mixed
+ */
+ public function setJob(ExportJob $job);
+
/**
* @param Collection $entries
*
diff --git a/app/Export/Collector/UploadCollector.php b/app/Export/Collector/UploadCollector.php
index 1895cb8a5e..35c2e75188 100644
--- a/app/Export/Collector/UploadCollector.php
+++ b/app/Export/Collector/UploadCollector.php
@@ -14,7 +14,6 @@ declare(strict_types = 1);
namespace FireflyIII\Export\Collector;
use Crypt;
-use FireflyIII\Models\ExportJob;
use Illuminate\Contracts\Encryption\DecryptException;
use Log;
use Storage;
@@ -35,22 +34,12 @@ class UploadCollector extends BasicCollector implements CollectorInterface
/**
* AttachmentCollector constructor.
- *
- * @param ExportJob $job
*/
- public function __construct(ExportJob $job)
+ public function __construct()
{
- parent::__construct($job);
-
- Log::debug('Going to collect attachments', ['key' => $job->key]);
-
- // make storage:
+ parent::__construct();
$this->uploadDisk = Storage::disk('upload');
$this->exportDisk = Storage::disk('export');
-
- // file names associated with the old import routine.
- $this->vintageFormat = sprintf('csv-upload-%d-', auth()->user()->id);
-
}
/**
@@ -60,6 +49,11 @@ class UploadCollector extends BasicCollector implements CollectorInterface
*/
public function run(): bool
{
+ Log::debug('Going to collect attachments', ['key' => $this->job->key]);
+
+ // file names associated with the old import routine.
+ $this->vintageFormat = sprintf('csv-upload-%d-', $this->job->user->id);
+
// collect old upload files (names beginning with "csv-upload".
$this->collectVintageUploads();
diff --git a/app/Export/Exporter/BasicExporter.php b/app/Export/Exporter/BasicExporter.php
index b16b19776a..256fa3b544 100644
--- a/app/Export/Exporter/BasicExporter.php
+++ b/app/Export/Exporter/BasicExporter.php
@@ -26,17 +26,15 @@ class BasicExporter
{
/** @var ExportJob */
protected $job;
- private $entries;
+ /** @var Collection */
+ private $entries;
/**
* BasicExporter constructor.
- *
- * @param ExportJob $job
*/
- public function __construct(ExportJob $job)
+ public function __construct()
{
$this->entries = new Collection;
- $this->job = $job;
}
/**
@@ -55,5 +53,13 @@ class BasicExporter
$this->entries = $entries;
}
+ /**
+ * @param ExportJob $job
+ */
+ public function setJob(ExportJob $job)
+ {
+ $this->job = $job;
+ }
+
}
diff --git a/app/Export/Exporter/CsvExporter.php b/app/Export/Exporter/CsvExporter.php
index b1f12f4e30..200bf8116d 100644
--- a/app/Export/Exporter/CsvExporter.php
+++ b/app/Export/Exporter/CsvExporter.php
@@ -14,7 +14,6 @@ declare(strict_types = 1);
namespace FireflyIII\Export\Exporter;
use FireflyIII\Export\Entry\Entry;
-use FireflyIII\Models\ExportJob;
use League\Csv\Writer;
use SplFileObject;
@@ -30,13 +29,10 @@ class CsvExporter extends BasicExporter implements ExporterInterface
/**
* CsvExporter constructor.
- *
- * @param ExportJob $job
*/
- public function __construct(ExportJob $job)
+ public function __construct()
{
- parent::__construct($job);
-
+ parent::__construct();
}
/**
diff --git a/app/Export/Exporter/ExporterInterface.php b/app/Export/Exporter/ExporterInterface.php
index 3559d89cec..9e267b4812 100644
--- a/app/Export/Exporter/ExporterInterface.php
+++ b/app/Export/Exporter/ExporterInterface.php
@@ -13,6 +13,7 @@ declare(strict_types = 1);
namespace FireflyIII\Export\Exporter;
+use FireflyIII\Models\ExportJob;
use Illuminate\Support\Collection;
/**
@@ -45,4 +46,9 @@ interface ExporterInterface
*/
public function setEntries(Collection $entries);
+ /**
+ * @param ExportJob $job
+ */
+ public function setJob(ExportJob $job);
+
}
diff --git a/app/Export/Processor.php b/app/Export/Processor.php
index 0d0421a460..cbbdd2736b 100644
--- a/app/Export/Processor.php
+++ b/app/Export/Processor.php
@@ -19,7 +19,6 @@ use FireflyIII\Export\Collector\JournalExportCollector;
use FireflyIII\Export\Collector\UploadCollector;
use FireflyIII\Export\Entry\Entry;
use FireflyIII\Models\ExportJob;
-use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Support\Collection;
use Log;
use Storage;
@@ -54,21 +53,12 @@ class Processor implements ProcessorInterface
/**
* Processor constructor.
- *
- * @param array $settings
*/
- public function __construct(array $settings)
+ public function __construct()
{
- // save settings
- $this->settings = $settings;
- $this->accounts = $settings['accounts'];
- $this->exportFormat = $settings['exportFormat'];
- $this->includeAttachments = $settings['includeAttachments'];
- $this->includeOldUploads = $settings['includeOldUploads'];
- $this->job = $settings['job'];
- $this->journals = new Collection;
- $this->exportEntries = new Collection;
- $this->files = new Collection;
+ $this->journals = new Collection;
+ $this->exportEntries = new Collection;
+ $this->files = new Collection;
}
@@ -78,7 +68,8 @@ class Processor implements ProcessorInterface
public function collectAttachments(): bool
{
/** @var AttachmentCollector $attachmentCollector */
- $attachmentCollector = app(AttachmentCollector::class, [$this->job]);
+ $attachmentCollector = app(AttachmentCollector::class);
+ $attachmentCollector->setJob($this->job);
$attachmentCollector->setDates($this->settings['startDate'], $this->settings['endDate']);
$attachmentCollector->run();
$this->files = $this->files->merge($attachmentCollector->getEntries());
@@ -92,7 +83,8 @@ class Processor implements ProcessorInterface
public function collectJournals(): bool
{
/** @var JournalExportCollector $collector */
- $collector = app(JournalExportCollector::class, [$this->job]);
+ $collector = app(JournalExportCollector::class);
+ $collector->setJob($this->job);
$collector->setDates($this->settings['startDate'], $this->settings['endDate']);
$collector->setAccounts($this->settings['accounts']);
$collector->run();
@@ -108,7 +100,8 @@ class Processor implements ProcessorInterface
public function collectOldUploads(): bool
{
/** @var UploadCollector $uploadCollector */
- $uploadCollector = app(UploadCollector::class, [$this->job]);
+ $uploadCollector = app(UploadCollector::class);
+ $uploadCollector->setJob($this->job);
$uploadCollector->run();
$this->files = $this->files->merge($uploadCollector->getEntries());
@@ -166,7 +159,8 @@ class Processor implements ProcessorInterface
public function exportJournals(): bool
{
$exporterClass = config('firefly.export_formats.' . $this->exportFormat);
- $exporter = app($exporterClass, [$this->job]);
+ $exporter = app($exporterClass);
+ $exporter->setJob($this->job);
$exporter->setEntries($this->exportEntries);
$exporter->run();
$this->files->push($exporter->getFileName());
@@ -182,6 +176,20 @@ class Processor implements ProcessorInterface
return $this->files;
}
+ /**
+ * @param array $settings
+ */
+ public function setSettings(array $settings)
+ {
+ // save settings
+ $this->settings = $settings;
+ $this->accounts = $settings['accounts'];
+ $this->exportFormat = $settings['exportFormat'];
+ $this->includeAttachments = $settings['includeAttachments'];
+ $this->includeOldUploads = $settings['includeOldUploads'];
+ $this->job = $settings['job'];
+ }
+
/**
*
*/
diff --git a/app/Export/ProcessorInterface.php b/app/Export/ProcessorInterface.php
index 614d748304..540dbcaf37 100644
--- a/app/Export/ProcessorInterface.php
+++ b/app/Export/ProcessorInterface.php
@@ -25,11 +25,8 @@ interface ProcessorInterface
/**
* Processor constructor.
- *
- * @param array $settings
- *
*/
- public function __construct(array $settings);
+ public function __construct();
/**
* @return bool
@@ -65,4 +62,9 @@ interface ProcessorInterface
* @return Collection
*/
public function getFiles(): Collection;
+
+ /**
+ * @param array $settings
+ */
+ public function setSettings(array $settings);
}
diff --git a/app/Generator/Report/Audit/MonthReportGenerator.php b/app/Generator/Report/Audit/MonthReportGenerator.php
index 9c21b1a0ba..02cc9d08c2 100644
--- a/app/Generator/Report/Audit/MonthReportGenerator.php
+++ b/app/Generator/Report/Audit/MonthReportGenerator.php
@@ -139,7 +139,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
{
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAccounts(new Collection([$account]))->setRange($this->start, $this->end);
$journals = $collector->getJournals();
$journals = $journals->reverse();
diff --git a/app/Generator/Report/Budget/MonthReportGenerator.php b/app/Generator/Report/Budget/MonthReportGenerator.php
index 38a53aad79..3ab5227ecc 100644
--- a/app/Generator/Report/Budget/MonthReportGenerator.php
+++ b/app/Generator/Report/Budget/MonthReportGenerator.php
@@ -185,7 +185,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
}
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)
->setTypes([TransactionType::WITHDRAWAL])
->setBudgets($this->budgets)->withOpposingAccount()->disableFilter();
diff --git a/app/Generator/Report/Category/MonthReportGenerator.php b/app/Generator/Report/Category/MonthReportGenerator.php
index 5517d7be13..865121006e 100644
--- a/app/Generator/Report/Category/MonthReportGenerator.php
+++ b/app/Generator/Report/Category/MonthReportGenerator.php
@@ -195,7 +195,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
}
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)
->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])
->setCategories($this->categories)->withOpposingAccount()->disableFilter();
@@ -218,7 +219,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
}
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)
->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER])
->setCategories($this->categories)->withOpposingAccount();
diff --git a/app/Helpers/Chart/MetaPieChart.php b/app/Helpers/Chart/MetaPieChart.php
index fbeb70cc25..e83b103ba0 100644
--- a/app/Helpers/Chart/MetaPieChart.php
+++ b/app/Helpers/Chart/MetaPieChart.php
@@ -85,7 +85,8 @@ class MetaPieChart implements MetaPieChartInterface
// also collect all other transactions
if ($this->collectOtherObjects && $direction === 'expense') {
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [$this->user]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser($this->user);
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)->setTypes([TransactionType::WITHDRAWAL]);
$journals = $collector->getJournals();
$sum = strval($journals->sum('transaction_amount'));
@@ -96,7 +97,8 @@ class MetaPieChart implements MetaPieChartInterface
if ($this->collectOtherObjects && $direction === 'income') {
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)->setTypes([TransactionType::DEPOSIT]);
$journals = $collector->getJournals();
$sum = strval($journals->sum('transaction_amount'));
@@ -201,7 +203,8 @@ class MetaPieChart implements MetaPieChartInterface
$modifier = 1;
}
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAccounts($this->accounts);
$collector->setRange($this->start, $this->end);
$collector->setTypes($types);
@@ -258,7 +261,8 @@ class MetaPieChart implements MetaPieChartInterface
{
$chartData = [];
$names = [];
- $repository = app($this->repositories[$type], [$this->user]);
+ $repository = app($this->repositories[$type]);
+ $repository->setUser($this->user);
foreach ($array as $objectId => $amount) {
if (!isset($names[$objectId])) {
$object = $repository->find(intval($objectId));
diff --git a/app/Helpers/Collector/JournalCollector.php b/app/Helpers/Collector/JournalCollector.php
index c198da7764..6e2d7a0d8e 100644
--- a/app/Helpers/Collector/JournalCollector.php
+++ b/app/Helpers/Collector/JournalCollector.php
@@ -96,17 +96,6 @@ class JournalCollector implements JournalCollectorInterface
/** @var User */
private $user;
- /**
- * JournalCollector constructor.
- *
- * @param User $user
- */
- public function __construct(User $user)
- {
- $this->user = $user;
- $this->query = $this->startQuery();
- }
-
/**
* @return int
* @throws FireflyException
@@ -168,7 +157,7 @@ class JournalCollector implements JournalCollectorInterface
{
$this->run = true;
/** @var Collection $set */
- $set = $this->query->get(array_values($this->fields));
+ $set = $this->query->get(array_values($this->fields));
Log::debug(sprintf('Count of set is %d', $set->count()));
$set = $this->filterTransfers($set);
Log::debug(sprintf('Count of set after filterTransfers() is %d', $set->count()));
@@ -244,7 +233,8 @@ class JournalCollector implements JournalCollectorInterface
public function setAllAssetAccounts(): JournalCollectorInterface
{
/** @var AccountRepositoryInterface $repository */
- $repository = app(AccountRepositoryInterface::class, [$this->user]);
+ $repository = app(AccountRepositoryInterface::class);
+ $repository->setUser($this->user);
$accounts = $repository->getAccountsByType([AccountType::ASSET, AccountType::DEFAULT]);
if ($accounts->count() > 0) {
$accountIds = $accounts->pluck('id')->toArray();
@@ -456,6 +446,37 @@ class JournalCollector implements JournalCollectorInterface
return $this;
}
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user)
+ {
+ $this->user = $user;
+ }
+
+ /**
+ *
+ */
+ public function startQuery()
+ {
+ /** @var EloquentBuilder $query */
+ $query = Transaction::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
+ ->leftJoin('transaction_currencies', 'transaction_currencies.id', 'transaction_journals.transaction_currency_id')
+ ->leftJoin('transaction_types', 'transaction_types.id', 'transaction_journals.transaction_type_id')
+ ->leftJoin('bills', 'bills.id', 'transaction_journals.bill_id')
+ ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')
+ ->leftJoin('account_types', 'accounts.account_type_id', 'account_types.id')
+ ->whereNull('transactions.deleted_at')
+ ->whereNull('transaction_journals.deleted_at')
+ ->where('transaction_journals.user_id', $this->user->id)
+ ->orderBy('transaction_journals.date', 'DESC')
+ ->orderBy('transaction_journals.order', 'ASC')
+ ->orderBy('transaction_journals.id', 'DESC');
+
+ $this->query = $query;
+
+ }
+
/**
* @return JournalCollectorInterface
*/
@@ -729,27 +750,4 @@ class JournalCollector implements JournalCollectorInterface
$this->query->leftJoin('tag_transaction_journal', 'tag_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id');
}
}
-
- /**
- * @return EloquentBuilder
- */
- private function startQuery(): EloquentBuilder
- {
- /** @var EloquentBuilder $query */
- $query = Transaction::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
- ->leftJoin('transaction_currencies', 'transaction_currencies.id', 'transaction_journals.transaction_currency_id')
- ->leftJoin('transaction_types', 'transaction_types.id', 'transaction_journals.transaction_type_id')
- ->leftJoin('bills', 'bills.id', 'transaction_journals.bill_id')
- ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')
- ->leftJoin('account_types', 'accounts.account_type_id', 'account_types.id')
- ->whereNull('transactions.deleted_at')
- ->whereNull('transaction_journals.deleted_at')
- ->where('transaction_journals.user_id', $this->user->id)
- ->orderBy('transaction_journals.date', 'DESC')
- ->orderBy('transaction_journals.order', 'ASC')
- ->orderBy('transaction_journals.id', 'DESC');
-
- return $query;
-
- }
}
diff --git a/app/Helpers/Collector/JournalCollectorInterface.php b/app/Helpers/Collector/JournalCollectorInterface.php
index b3307ebac0..80e41eb781 100644
--- a/app/Helpers/Collector/JournalCollectorInterface.php
+++ b/app/Helpers/Collector/JournalCollectorInterface.php
@@ -17,6 +17,7 @@ use Carbon\Carbon;
use FireflyIII\Models\Budget;
use FireflyIII\Models\Category;
use FireflyIII\Models\Tag;
+use FireflyIII\User;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
@@ -27,7 +28,6 @@ use Illuminate\Support\Collection;
*/
interface JournalCollectorInterface
{
-
/**
* @return int
*/
@@ -84,7 +84,6 @@ interface JournalCollectorInterface
*/
public function setBudget(Budget $budget): JournalCollectorInterface;
-
/**
* @param Collection $budgets
*
@@ -149,6 +148,13 @@ interface JournalCollectorInterface
*/
public function setTypes(array $types): JournalCollectorInterface;
+ public function setUser(User $user);
+
+ /**
+ *
+ */
+ public function startQuery();
+
/**
* @return JournalCollectorInterface
*/
diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.php
index 40b7b68eaf..f49805cd1b 100644
--- a/app/Helpers/Report/ReportHelper.php
+++ b/app/Helpers/Report/ReportHelper.php
@@ -68,7 +68,8 @@ class ReportHelper implements ReportHelperInterface
/** @var BillRepositoryInterface $repository */
$repository = app(BillRepositoryInterface::class);
$bills = $repository->getBillsForAccounts($accounts);
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAccounts($accounts)->setRange($start, $end)->setBills($bills);
$journals = $collector->getJournals();
$collection = new BillCollection;
diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php
index e68ee7f8bd..6ba0cc2248 100644
--- a/app/Http/Controllers/AccountController.php
+++ b/app/Http/Controllers/AccountController.php
@@ -23,7 +23,6 @@ use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
use FireflyIII\Models\Transaction;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
-use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI;
use FireflyIII\Repositories\Account\AccountTaskerInterface;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Support\CacheProperties;
@@ -96,12 +95,12 @@ class AccountController extends Controller
}
/**
- * @param ARI $repository
- * @param Account $account
+ * @param AccountRepositoryInterface $repository
+ * @param Account $account
*
* @return View
*/
- public function delete(ARI $repository, Account $account)
+ public function delete(AccountRepositoryInterface $repository, Account $account)
{
$typeName = config('firefly.shortNamesByFullName.' . $account->accountType->type);
$subTitle = trans('firefly.delete_' . $typeName . '_account', ['name' => $account->name]);
@@ -118,12 +117,12 @@ class AccountController extends Controller
/**
* @param Request $request
- * @param ARI $repository
+ * @param AccountRepositoryInterface $repository
* @param Account $account
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function destroy(Request $request, ARI $repository, Account $account)
+ public function destroy(Request $request, AccountRepositoryInterface $repository, Account $account)
{
$type = $account->accountType->type;
$typeName = config('firefly.shortNamesByFullName.' . $type);
@@ -191,12 +190,12 @@ class AccountController extends Controller
}
/**
- * @param ARI $repository
+ * @param AccountRepositoryInterface $repository
* @param string $what
*
* @return View
*/
- public function index(ARI $repository, string $what)
+ public function index(AccountRepositoryInterface $repository, string $what)
{
$what = $what ?? 'asset';
$subTitle = trans('firefly.' . $what . '_accounts');
@@ -262,7 +261,7 @@ class AccountController extends Controller
/**
* @param Request $request
- * @param ARI $repository
+ * @param AccountRepositoryInterface $repository
* @param Account $account
*
* @return View
@@ -276,7 +275,8 @@ class AccountController extends Controller
// replace with journal collector:
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAccounts(new Collection([$account]))->setLimit($pageSize)->setPage($page);
$journals = $collector->getPaginatedJournals();
$journals->setPath('accounts/show/' . $account->id . '/all');
@@ -310,7 +310,8 @@ class AccountController extends Controller
// replace with journal collector:
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAccounts(new Collection([$account]))->setRange($start, $end)->setLimit($pageSize)->setPage($page);
$journals = $collector->getPaginatedJournals();
$journals->setPath('accounts/show/' . $account->id . '/' . $date);
@@ -324,12 +325,12 @@ class AccountController extends Controller
/**
* @param AccountFormRequest $request
- * @param ARI $repository
+ * @param AccountRepositoryInterface $repository
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*
*/
- public function store(AccountFormRequest $request, ARI $repository)
+ public function store(AccountFormRequest $request, AccountRepositoryInterface $repository)
{
$data = $request->getAccountData();
$account = $repository->store($data);
@@ -357,12 +358,12 @@ class AccountController extends Controller
/**
* @param AccountFormRequest $request
- * @param ARI $repository
+ * @param AccountRepositoryInterface $repository
* @param Account $account
*
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
- public function update(AccountFormRequest $request, ARI $repository, Account $account)
+ public function update(AccountFormRequest $request, AccountRepositoryInterface $repository, Account $account)
{
$data = $request->getAccountData();
$repository->update($account, $data);
@@ -409,8 +410,8 @@ class AccountController extends Controller
*/
private function periodEntries(Account $account): Collection
{
- /** @var ARI $repository */
- $repository = app(ARI::class);
+ /** @var AccountRepositoryInterface $repository */
+ $repository = app(AccountRepositoryInterface::class);
/** @var AccountTaskerInterface $tasker */
$tasker = app(AccountTaskerInterface::class);
diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.php
index 916cc7c406..c6aa3c0509 100644
--- a/app/Http/Controllers/BillController.php
+++ b/app/Http/Controllers/BillController.php
@@ -208,7 +208,8 @@ class BillController extends Controller
// use collector:
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAllAssetAccounts()->setBills(new Collection([$bill]))->setLimit($pageSize)->setPage($page)->withBudgetInformation()
->withCategoryInformation();
$journals = $collector->getPaginatedJournals();
diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php
index 1f2d510dcb..d85670dbfe 100644
--- a/app/Http/Controllers/BudgetController.php
+++ b/app/Http/Controllers/BudgetController.php
@@ -202,7 +202,8 @@ class BudgetController extends Controller
// collector
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAllAssetAccounts()->setRange($start, $end)->setLimit($pageSize)->setPage($page)->withoutBudget();
$journals = $collector->getPaginatedJournals();
$journals->setPath('/budgets/list/noBudget');
@@ -243,7 +244,8 @@ class BudgetController extends Controller
$repetition = null;
// collector:
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAllAssetAccounts()->setRange($start, $end)->setBudget($budget)->setLimit($pageSize)->setPage($page)->withCategoryInformation();
$journals = $collector->getPaginatedJournals();
$journals->setPath('/budgets/show/' . $budget->id);
@@ -280,7 +282,8 @@ class BudgetController extends Controller
// collector:
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAllAssetAccounts()->setRange($budgetLimit->start_date, $budgetLimit->end_date)
->setBudget($budget)->setLimit($pageSize)->setPage($page)->withCategoryInformation();
$journals = $collector->getPaginatedJournals();
diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php
index e74786199c..ab8583af1a 100644
--- a/app/Http/Controllers/CategoryController.php
+++ b/app/Http/Controllers/CategoryController.php
@@ -157,7 +157,8 @@ class CategoryController extends Controller
// new collector:
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAllAssetAccounts()->setRange($start, $end)->withoutCategory();//->groupJournals();
$journals = $collector->getJournals();
$subTitle = trans(
diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php
index 0a8fe543cf..2c792fa908 100644
--- a/app/Http/Controllers/Chart/BudgetController.php
+++ b/app/Http/Controllers/Chart/BudgetController.php
@@ -416,7 +416,8 @@ class BudgetController extends Controller
{
// collector
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$types = [TransactionType::WITHDRAWAL];
$collector->setAllAssetAccounts()->setTypes($types)->setRange($start, $end)->withoutBudget();
$journals = $collector->getJournals();
diff --git a/app/Http/Controllers/Chart/BudgetReportController.php b/app/Http/Controllers/Chart/BudgetReportController.php
index d131f8a661..b5ab26355c 100644
--- a/app/Http/Controllers/Chart/BudgetReportController.php
+++ b/app/Http/Controllers/Chart/BudgetReportController.php
@@ -239,7 +239,8 @@ class BudgetReportController extends Controller
private function getExpenses(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end): Collection
{
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAccounts($accounts)->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])
->setBudgets($budgets)->withOpposingAccount()->disableFilter();
$accountIds = $accounts->pluck('id')->toArray();
diff --git a/app/Http/Controllers/Chart/CategoryReportController.php b/app/Http/Controllers/Chart/CategoryReportController.php
index e156becd7e..0cd50c308c 100644
--- a/app/Http/Controllers/Chart/CategoryReportController.php
+++ b/app/Http/Controllers/Chart/CategoryReportController.php
@@ -284,7 +284,8 @@ class CategoryReportController extends Controller
private function getExpenses(Collection $accounts, Collection $categories, Carbon $start, Carbon $end): Collection
{
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAccounts($accounts)->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])
->setCategories($categories)->withOpposingAccount()->disableFilter();
$accountIds = $accounts->pluck('id')->toArray();
@@ -305,7 +306,8 @@ class CategoryReportController extends Controller
private function getIncome(Collection $accounts, Collection $categories, Carbon $start, Carbon $end): Collection
{
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAccounts($accounts)->setRange($start, $end)->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER])
->setCategories($categories)->withOpposingAccount();
$accountIds = $accounts->pluck('id')->toArray();
diff --git a/app/Http/Controllers/ExportController.php b/app/Http/Controllers/ExportController.php
index 1ace8118c1..823c82e928 100644
--- a/app/Http/Controllers/ExportController.php
+++ b/app/Http/Controllers/ExportController.php
@@ -150,7 +150,8 @@ class ExportController extends Controller
$jobs->changeStatus($job, 'export_status_make_exporter');
/** @var ProcessorInterface $processor */
- $processor = app(ProcessorInterface::class, [$settings]);
+ $processor = app(ProcessorInterface::class);
+ $processor->setSettings($settings);
/*
* Collect journals:
diff --git a/app/Http/Controllers/Popup/ReportController.php b/app/Http/Controllers/Popup/ReportController.php
index 0f436dc962..7bd8803fa5 100644
--- a/app/Http/Controllers/Popup/ReportController.php
+++ b/app/Http/Controllers/Popup/ReportController.php
@@ -103,7 +103,8 @@ class ReportController extends Controller
switch (true) {
case ($role === BalanceLine::ROLE_DEFAULTROLE && !is_null($budget->id)):
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector
->setAccounts(new Collection([$account]))
->setRange($attributes['startDate'], $attributes['endDate'])
@@ -114,7 +115,8 @@ class ReportController extends Controller
case ($role === BalanceLine::ROLE_DEFAULTROLE && is_null($budget->id)):
$budget->name = strval(trans('firefly.no_budget'));
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector
->setAccounts(new Collection([$account]))
->setTypes($types)
@@ -124,7 +126,8 @@ class ReportController extends Controller
break;
case ($role === BalanceLine::ROLE_DIFFROLE):
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector
->setAccounts(new Collection([$account]))
->setTypes($types)
@@ -169,7 +172,8 @@ class ReportController extends Controller
$repository = app(BudgetRepositoryInterface::class);
$budget = $repository->find(intval($attributes['budgetId']));
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector
->setAccounts($attributes['accounts'])
@@ -203,7 +207,8 @@ class ReportController extends Controller
$category = $repository->find(intval($attributes['categoryId']));
$types = [TransactionType::WITHDRAWAL, TransactionType::TRANSFER];
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAccounts($attributes['accounts'])->setTypes($types)
->setRange($attributes['startDate'], $attributes['endDate'])
->setCategory($category);
@@ -230,7 +235,8 @@ class ReportController extends Controller
$account = $repository->find(intval($attributes['accountId']));
$types = [TransactionType::WITHDRAWAL, TransactionType::TRANSFER];
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAccounts(new Collection([$account]))->setRange($attributes['startDate'], $attributes['endDate'])->setTypes($types);
$journals = $collector->getJournals();
$report = $attributes['accounts']->pluck('id')->toArray(); // accounts used in this report
@@ -266,7 +272,8 @@ class ReportController extends Controller
$account = $repository->find(intval($attributes['accountId']));
$types = [TransactionType::DEPOSIT, TransactionType::TRANSFER];
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAccounts(new Collection([$account]))->setRange($attributes['startDate'], $attributes['endDate'])->setTypes($types);
$journals = $collector->getJournals();
$report = $attributes['accounts']->pluck('id')->toArray(); // accounts used in this report
diff --git a/app/Http/Controllers/RuleController.php b/app/Http/Controllers/RuleController.php
index 2eee1da8a0..e20830a819 100644
--- a/app/Http/Controllers/RuleController.php
+++ b/app/Http/Controllers/RuleController.php
@@ -289,7 +289,7 @@ class RuleController extends Controller
$range = config('firefly.test-triggers.range');
/** @var TransactionMatcher $matcher */
- $matcher = app('FireflyIII\Rules\TransactionMatcher');
+ $matcher = app(TransactionMatcher::class);
$matcher->setLimit($limit);
$matcher->setRange($range);
$matcher->setTriggers($triggers);
@@ -352,7 +352,7 @@ class RuleController extends Controller
private function createDefaultRule()
{
/** @var RuleRepositoryInterface $repository */
- $repository = app('FireflyIII\Repositories\Rule\RuleRepositoryInterface');
+ $repository = app(RuleRepositoryInterface::class);
if ($repository->count() === 0) {
$data = [
diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php
index 2ec3e8ce5c..ba38605b8f 100644
--- a/app/Http/Controllers/TransactionController.php
+++ b/app/Http/Controllers/TransactionController.php
@@ -72,7 +72,8 @@ class TransactionController extends Controller
$end = session('end', Navigation::endOfPeriod(new Carbon, $range));
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setTypes($types)->setLimit($pageSize)->setPage($page)->setAllAssetAccounts();
$collector->setRange($start, $end)->withBudgetInformation()->withCategoryInformation();
@@ -122,7 +123,8 @@ class TransactionController extends Controller
$subTitle = sprintf('%s (%s)', trans('firefly.title_' . $what), strtolower(trans('firefly.everything')));
$page = intval($request->get('page')) === 0 ? 1 : intval($request->get('page'));
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setTypes($types)->setLimit($pageSize)->setPage($page)->setAllAssetAccounts()->withBudgetInformation()->withCategoryInformation();
// do not filter transfers if $what = transfer.
@@ -161,7 +163,8 @@ class TransactionController extends Controller
Log::debug(sprintf('Transaction index by date will show between %s and %s', $start->format('Y-m-d'), $end->format('Y-m-d')));
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setTypes($types)->setLimit($pageSize)->setPage($page)->setAllAssetAccounts();
$collector->setRange($start, $end)->withBudgetInformation()->withCategoryInformation();
diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php
index 97320a2b3f..488a3857cd 100644
--- a/app/Http/Kernel.php
+++ b/app/Http/Kernel.php
@@ -49,9 +49,9 @@ class Kernel extends HttpKernel
*/
protected $bootstrappers
= [
- 'Illuminate\Foundation\Bootstrap\DetectEnvironment',
+ 'Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables',
'Illuminate\Foundation\Bootstrap\LoadConfiguration',
- 'FireflyIII\Bootstrap\ConfigureLogging',
+ //'FireflyIII\Bootstrap\ConfigureLogging',
'Illuminate\Foundation\Bootstrap\HandleExceptions',
'Illuminate\Foundation\Bootstrap\RegisterFacades',
'Illuminate\Foundation\Bootstrap\RegisterProviders',
diff --git a/app/Http/Requests/RuleGroupFormRequest.php b/app/Http/Requests/RuleGroupFormRequest.php
index fcf92d0105..b5917242d7 100644
--- a/app/Http/Requests/RuleGroupFormRequest.php
+++ b/app/Http/Requests/RuleGroupFormRequest.php
@@ -49,7 +49,8 @@ class RuleGroupFormRequest extends Request
public function rules()
{
/** @var RuleGroupRepositoryInterface $repository */
- $repository = app(RuleGroupRepositoryInterface::class, [auth()->user()]);
+ $repository = app(RuleGroupRepositoryInterface::class);
+ $repository->setUser(auth()->user());
$titleRule = 'required|between:1,100|uniqueObjectForUser:rule_groups,title';
if (!is_null($repository->find(intval($this->get('id')))->id)) {
$titleRule = 'required|between:1,100|uniqueObjectForUser:rule_groups,title,' . intval($this->get('id'));
diff --git a/app/Import/Converter/AccountId.php b/app/Import/Converter/AccountId.php
index 5b39999f2e..4c07790fa5 100644
--- a/app/Import/Converter/AccountId.php
+++ b/app/Import/Converter/AccountId.php
@@ -40,7 +40,8 @@ class AccountId extends BasicConverter implements ConverterInterface
return new Account;
}
/** @var AccountRepositoryInterface $repository */
- $repository = app(AccountRepositoryInterface::class, [$this->user]);
+ $repository = app(AccountRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
Log::debug('Found account in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
diff --git a/app/Import/Converter/AssetAccountIban.php b/app/Import/Converter/AssetAccountIban.php
index 9ed749a781..d2336c282d 100644
--- a/app/Import/Converter/AssetAccountIban.php
+++ b/app/Import/Converter/AssetAccountIban.php
@@ -43,7 +43,8 @@ class AssetAccountIban extends BasicConverter implements ConverterInterface
}
/** @var AccountRepositoryInterface $repository */
- $repository = app(AccountRepositoryInterface::class, [$this->user]);
+ $repository = app(AccountRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
diff --git a/app/Import/Converter/AssetAccountName.php b/app/Import/Converter/AssetAccountName.php
index 4785ae16d2..8618d52f2d 100644
--- a/app/Import/Converter/AssetAccountName.php
+++ b/app/Import/Converter/AssetAccountName.php
@@ -43,7 +43,8 @@ class AssetAccountName extends BasicConverter implements ConverterInterface
}
/** @var AccountRepositoryInterface $repository */
- $repository = app(AccountRepositoryInterface::class, [$this->user]);
+ $repository = app(AccountRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
diff --git a/app/Import/Converter/AssetAccountNumber.php b/app/Import/Converter/AssetAccountNumber.php
index 5c71bf57f1..d389492c91 100644
--- a/app/Import/Converter/AssetAccountNumber.php
+++ b/app/Import/Converter/AssetAccountNumber.php
@@ -41,7 +41,8 @@ class AssetAccountNumber extends BasicConverter implements ConverterInterface
}
/** @var AccountRepositoryInterface $repository */
- $repository = app(AccountRepositoryInterface::class, [$this->user]);
+ $repository = app(AccountRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
diff --git a/app/Import/Converter/BillId.php b/app/Import/Converter/BillId.php
index 06713afaf4..cb20e4c7c9 100644
--- a/app/Import/Converter/BillId.php
+++ b/app/Import/Converter/BillId.php
@@ -42,7 +42,8 @@ class BillId extends BasicConverter implements ConverterInterface
}
/** @var BillRepositoryInterface $repository */
- $repository = app(BillRepositoryInterface::class, [$this->user]);
+ $repository = app(BillRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
Log::debug('Found bill in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
diff --git a/app/Import/Converter/BillName.php b/app/Import/Converter/BillName.php
index 6c4aa2fc17..3d2dbe9a71 100644
--- a/app/Import/Converter/BillName.php
+++ b/app/Import/Converter/BillName.php
@@ -44,7 +44,8 @@ class BillName extends BasicConverter implements ConverterInterface
}
/** @var BillRepositoryInterface $repository */
- $repository = app(BillRepositoryInterface::class, [$this->user]);
+ $repository = app(BillRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
Log::debug('Found bill in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
diff --git a/app/Import/Converter/BudgetId.php b/app/Import/Converter/BudgetId.php
index 0fe769f70e..cf709c0beb 100644
--- a/app/Import/Converter/BudgetId.php
+++ b/app/Import/Converter/BudgetId.php
@@ -42,7 +42,8 @@ class BudgetId extends BasicConverter implements ConverterInterface
}
/** @var BudgetRepositoryInterface $repository */
- $repository = app(BudgetRepositoryInterface::class, [$this->user]);
+ $repository = app(BudgetRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
Log::debug('Found budget in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
diff --git a/app/Import/Converter/BudgetName.php b/app/Import/Converter/BudgetName.php
index fc5d5416fc..7ecd85530c 100644
--- a/app/Import/Converter/BudgetName.php
+++ b/app/Import/Converter/BudgetName.php
@@ -42,7 +42,8 @@ class BudgetName extends BasicConverter implements ConverterInterface
}
/** @var BudgetRepositoryInterface $repository */
- $repository = app(BudgetRepositoryInterface::class, [$this->user]);
+ $repository = app(BudgetRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
Log::debug('Found budget in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
diff --git a/app/Import/Converter/CategoryId.php b/app/Import/Converter/CategoryId.php
index 5d538f4b90..2544a61597 100644
--- a/app/Import/Converter/CategoryId.php
+++ b/app/Import/Converter/CategoryId.php
@@ -42,7 +42,8 @@ class CategoryId extends BasicConverter implements ConverterInterface
}
/** @var CategoryRepositoryInterface $repository */
- $repository = app(CategoryRepositoryInterface::class, [$this->user]);
+ $repository = app(CategoryRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
Log::debug('Found category in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
diff --git a/app/Import/Converter/CategoryName.php b/app/Import/Converter/CategoryName.php
index 28e7650c1f..f8af2414b1 100644
--- a/app/Import/Converter/CategoryName.php
+++ b/app/Import/Converter/CategoryName.php
@@ -42,7 +42,8 @@ class CategoryName extends BasicConverter implements ConverterInterface
}
/** @var CategoryRepositoryInterface $repository */
- $repository = app(CategoryRepositoryInterface::class, [$this->user]);
+ $repository = app(CategoryRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
Log::debug('Found category in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
diff --git a/app/Import/Converter/CurrencyCode.php b/app/Import/Converter/CurrencyCode.php
index 48901cceaa..f78433ddf3 100644
--- a/app/Import/Converter/CurrencyCode.php
+++ b/app/Import/Converter/CurrencyCode.php
@@ -36,6 +36,7 @@ class CurrencyCode extends BasicConverter implements ConverterInterface
/** @var CurrencyRepositoryInterface $repository */
$repository = app(CurrencyRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
Log::debug('Found currency in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
diff --git a/app/Import/Converter/CurrencyId.php b/app/Import/Converter/CurrencyId.php
index 6622899264..299cde1bf3 100644
--- a/app/Import/Converter/CurrencyId.php
+++ b/app/Import/Converter/CurrencyId.php
@@ -42,7 +42,8 @@ class CurrencyId extends BasicConverter implements ConverterInterface
}
/** @var CurrencyRepositoryInterface $repository */
- $repository = app(CurrencyRepositoryInterface::class, [$this->user]);
+ $repository = app(CurrencyRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
Log::debug('Found currency in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
diff --git a/app/Import/Converter/CurrencyName.php b/app/Import/Converter/CurrencyName.php
index ad28107f4b..71af377582 100644
--- a/app/Import/Converter/CurrencyName.php
+++ b/app/Import/Converter/CurrencyName.php
@@ -42,7 +42,8 @@ class CurrencyName extends BasicConverter implements ConverterInterface
}
/** @var CurrencyRepositoryInterface $repository */
- $repository = app(CurrencyRepositoryInterface::class, [$this->user]);
+ $repository = app(CurrencyRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
Log::debug('Found currency in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
diff --git a/app/Import/Converter/CurrencySymbol.php b/app/Import/Converter/CurrencySymbol.php
index 307d409cd0..27ed50dd48 100644
--- a/app/Import/Converter/CurrencySymbol.php
+++ b/app/Import/Converter/CurrencySymbol.php
@@ -42,7 +42,8 @@ class CurrencySymbol extends BasicConverter implements ConverterInterface
}
/** @var CurrencyRepositoryInterface $repository */
- $repository = app(CurrencyRepositoryInterface::class, [$this->user]);
+ $repository = app(CurrencyRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
Log::debug('Found currency in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]);
diff --git a/app/Import/Converter/OpposingAccountIban.php b/app/Import/Converter/OpposingAccountIban.php
index c3dacbd712..ee8b40747c 100644
--- a/app/Import/Converter/OpposingAccountIban.php
+++ b/app/Import/Converter/OpposingAccountIban.php
@@ -43,7 +43,8 @@ class OpposingAccountIban extends BasicConverter implements ConverterInterface
}
/** @var AccountRepositoryInterface $repository */
- $repository = app(AccountRepositoryInterface::class, [$this->user]);
+ $repository = app(AccountRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
diff --git a/app/Import/Converter/OpposingAccountName.php b/app/Import/Converter/OpposingAccountName.php
index 4516873a25..fa51245fd6 100644
--- a/app/Import/Converter/OpposingAccountName.php
+++ b/app/Import/Converter/OpposingAccountName.php
@@ -42,7 +42,8 @@ class OpposingAccountName extends BasicConverter implements ConverterInterface
}
/** @var AccountRepositoryInterface $repository */
- $repository = app(AccountRepositoryInterface::class, [$this->user]);
+ $repository = app(AccountRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
diff --git a/app/Import/Converter/OpposingAccountNumber.php b/app/Import/Converter/OpposingAccountNumber.php
index 86df680223..d513a88ae0 100644
--- a/app/Import/Converter/OpposingAccountNumber.php
+++ b/app/Import/Converter/OpposingAccountNumber.php
@@ -43,7 +43,8 @@ class OpposingAccountNumber extends BasicConverter implements ConverterInterface
}
/** @var AccountRepositoryInterface $repository */
- $repository = app(AccountRepositoryInterface::class, [$this->user]);
+ $repository = app(AccountRepositoryInterface::class);
+ $repository->setUser($this->user);
if (isset($this->mapping[$value])) {
diff --git a/app/Import/Converter/TagSplit.php b/app/Import/Converter/TagSplit.php
index cc99561663..d93074b7d0 100644
--- a/app/Import/Converter/TagSplit.php
+++ b/app/Import/Converter/TagSplit.php
@@ -39,7 +39,8 @@ class TagSplit
Log::debug('Exploded parts.', $parts);
/** @var TagRepositoryInterface $repository */
- $repository = app(TagRepositoryInterface::class, [$user]);
+ $repository = app(TagRepositoryInterface::class);
+ $repository->setUser($user);
/** @var string $part */
diff --git a/app/Import/ImportProcedure.php b/app/Import/ImportProcedure.php
index c535d47fae..991c5addcd 100644
--- a/app/Import/ImportProcedure.php
+++ b/app/Import/ImportProcedure.php
@@ -58,7 +58,8 @@ class ImportProcedure implements ImportProcedureInterface
if ($job->configuration['import-account'] != 0) {
/** @var AccountRepositoryInterface $repository */
- $repository = app(AccountRepositoryInterface::class, [$job->user]);
+ $repository = app(AccountRepositoryInterface::class);
+ $repository->setUser($job->user);
$validator->setDefaultImportAccount($repository->find($job->configuration['import-account']));
}
diff --git a/app/Import/ImportStorage.php b/app/Import/ImportStorage.php
index 4edf17d5f8..12b5e33a6c 100644
--- a/app/Import/ImportStorage.php
+++ b/app/Import/ImportStorage.php
@@ -159,7 +159,8 @@ class ImportStorage
private function createImportTag(): Tag
{
/** @var TagRepositoryInterface $repository */
- $repository = app(TagRepositoryInterface::class, [$this->user]);
+ $repository = app(TagRepositoryInterface::class);
+ $repository->setUser($this->user);
$data = [
'tag' => trans('firefly.import_with_key', ['key' => $this->job->key]),
'date' => new Carbon,
diff --git a/app/Import/ImportValidator.php b/app/Import/ImportValidator.php
index d6d15d3ed2..9a5a254151 100644
--- a/app/Import/ImportValidator.php
+++ b/app/Import/ImportValidator.php
@@ -177,7 +177,8 @@ class ImportValidator
// find it first by new type:
/** @var AccountRepositoryInterface $repository */
- $repository = app(AccountRepositoryInterface::class, [$this->user]);
+ $repository = app(AccountRepositoryInterface::class);
+ $repository->setUser($this->user);
$result = $repository->findByName($account->name, [$type]);
if (is_null($result->id)) {
@@ -214,7 +215,8 @@ class ImportValidator
{
/** @var AccountRepositoryInterface $repository */
- $repository = app(AccountRepositoryInterface::class, [$this->user]);
+ $repository = app(AccountRepositoryInterface::class);
+ $repository->setUser($this->user);
$name = 'Unknown expense account';
$result = $repository->findByName($name, [AccountType::EXPENSE]);
@@ -235,7 +237,8 @@ class ImportValidator
{
/** @var AccountRepositoryInterface $repository */
- $repository = app(AccountRepositoryInterface::class, [$this->user]);
+ $repository = app(AccountRepositoryInterface::class);
+ $repository->setUser($this->user);
$name = 'Unknown revenue account';
$result = $repository->findByName($name, [AccountType::REVENUE]);
@@ -382,7 +385,8 @@ class ImportValidator
{
if (is_null($entry->fields['currency'])) {
/** @var CurrencyRepositoryInterface $repository */
- $repository = app(CurrencyRepositoryInterface::class, [$this->user]);
+ $repository = app(CurrencyRepositoryInterface::class);
+ $repository->setUser($this->user);
// is the default currency for the user or the system
$defaultCode = Preferences::getForUser($this->user, 'currencyPreference', config('firefly.default_currency', 'EUR'))->data;
diff --git a/app/Import/Setup/CsvSetup.php b/app/Import/Setup/CsvSetup.php
index 20c938bda3..ff20d45958 100644
--- a/app/Import/Setup/CsvSetup.php
+++ b/app/Import/Setup/CsvSetup.php
@@ -181,7 +181,8 @@ class CsvSetup implements SetupInterface
public function saveImportConfiguration(array $data, FileBag $files): bool
{
/** @var AccountRepositoryInterface $repository */
- $repository = app(AccountRepositoryInterface::class, [auth()->user()]);
+ $repository = app(AccountRepositoryInterface::class);
+ $repository->setUser(auth()->user());
$importId = $data['csv_import_account'] ?? 0;
$account = $repository->find(intval($importId));
diff --git a/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php b/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php
index 1678cb2bcc..15a852414e 100644
--- a/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php
+++ b/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php
@@ -156,7 +156,8 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue
protected function collectJournals()
{
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAccounts($this->accounts)->setRange($this->startDate, $this->endDate);
return $collector->getJournals();
diff --git a/app/Providers/AccountServiceProvider.php b/app/Providers/AccountServiceProvider.php
index 0ce5a90329..3035731adb 100644
--- a/app/Providers/AccountServiceProvider.php
+++ b/app/Providers/AccountServiceProvider.php
@@ -14,7 +14,10 @@ declare(strict_types = 1);
namespace FireflyIII\Providers;
-use FireflyIII\Exceptions\FireflyException;
+use FireflyIII\Repositories\Account\AccountRepository;
+use FireflyIII\Repositories\Account\AccountRepositoryInterface;
+use FireflyIII\Repositories\Account\AccountTasker;
+use FireflyIII\Repositories\Account\AccountTaskerInterface;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
@@ -44,8 +47,6 @@ class AccountServiceProvider extends ServiceProvider
{
$this->registerRepository();
$this->registerTasker();
-
-
}
/**
@@ -54,16 +55,16 @@ class AccountServiceProvider extends ServiceProvider
private function registerRepository()
{
$this->app->bind(
- 'FireflyIII\Repositories\Account\AccountRepositoryInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Repositories\Account\AccountRepository', [auth()->user()]);
- }
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
+ AccountRepositoryInterface::class,
+ function (Application $app) {
+ /** @var AccountRepositoryInterface $repository */
+ $repository = app(AccountRepository::class);
+
+ if ($app->auth->check()) {
+ $repository->setUser(auth()->user());
}
- return app('FireflyIII\Repositories\Account\AccountRepository', $arguments);
+ return $repository;
}
);
}
@@ -74,16 +75,16 @@ class AccountServiceProvider extends ServiceProvider
private function registerTasker()
{
$this->app->bind(
- 'FireflyIII\Repositories\Account\AccountTaskerInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Repositories\Account\AccountTasker', [auth()->user()]);
- }
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
+ AccountTaskerInterface::class,
+ function (Application $app) {
+ /** @var AccountTaskerInterface $tasker */
+ $tasker = app(AccountTasker::class);
+
+ if ($app->auth->check()) {
+ $tasker->setUser(auth()->user());
}
- return app('FireflyIII\Repositories\Account\AccountTasker', $arguments);
+ return $tasker;
}
);
}
diff --git a/app/Providers/AttachmentServiceProvider.php b/app/Providers/AttachmentServiceProvider.php
index 77debb7354..c9f3a9d48d 100644
--- a/app/Providers/AttachmentServiceProvider.php
+++ b/app/Providers/AttachmentServiceProvider.php
@@ -14,7 +14,8 @@ declare(strict_types = 1);
namespace FireflyIII\Providers;
-use FireflyIII\Exceptions\FireflyException;
+use FireflyIII\Repositories\Attachment\AttachmentRepository;
+use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
@@ -43,16 +44,15 @@ class AttachmentServiceProvider extends ServiceProvider
public function register()
{
$this->app->bind(
- 'FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Repositories\Attachment\AttachmentRepository', [auth()->user()]);
- }
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
+ AttachmentRepositoryInterface::class,
+ function (Application $app) {
+ /** @var AttachmentRepositoryInterface $repository */
+ $repository = app(AttachmentRepository::class);
+ if ($app->auth->check()) {
+ $repository->setUser(auth()->user());
}
- return app('FireflyIII\Repositories\Attachment\AttachmentRepository', $arguments);
+ return $repository;
}
);
}
diff --git a/app/Providers/BillServiceProvider.php b/app/Providers/BillServiceProvider.php
index 7275348a8d..a07e8e37ff 100644
--- a/app/Providers/BillServiceProvider.php
+++ b/app/Providers/BillServiceProvider.php
@@ -14,7 +14,8 @@ declare(strict_types = 1);
namespace FireflyIII\Providers;
-use FireflyIII\Exceptions\FireflyException;
+use FireflyIII\Repositories\Bill\BillRepository;
+use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
@@ -43,16 +44,16 @@ class BillServiceProvider extends ServiceProvider
public function register()
{
$this->app->bind(
- 'FireflyIII\Repositories\Bill\BillRepositoryInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Repositories\Bill\BillRepository', [auth()->user()]);
- }
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
+ BillRepositoryInterface::class,
+ function (Application $app) {
+ /** @var BillRepositoryInterface $repository */
+ $repository = app(BillRepository::class);
+
+ if ($app->auth->check()) {
+ $repository->setUser(auth()->user());
}
- return app('FireflyIII\Repositories\Bill\BillRepository', $arguments);
+ return $repository;
}
);
}
diff --git a/app/Providers/BudgetServiceProvider.php b/app/Providers/BudgetServiceProvider.php
index 51408c5098..df87739ea6 100644
--- a/app/Providers/BudgetServiceProvider.php
+++ b/app/Providers/BudgetServiceProvider.php
@@ -14,7 +14,8 @@ declare(strict_types = 1);
namespace FireflyIII\Providers;
-use FireflyIII\Exceptions\FireflyException;
+use FireflyIII\Repositories\Budget\BudgetRepository;
+use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
@@ -43,16 +44,15 @@ class BudgetServiceProvider extends ServiceProvider
public function register()
{
$this->app->bind(
- 'FireflyIII\Repositories\Budget\BudgetRepositoryInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Repositories\Budget\BudgetRepository', [auth()->user()]);
- }
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
+ BudgetRepositoryInterface::class,
+ function (Application $app) {
+ /** @var BudgetRepositoryInterface $repository */
+ $repository = app(BudgetRepository::class);
+ if ($app->auth->check()) {
+ $repository->setUser(auth()->user());
}
- return app('FireflyIII\Repositories\Budget\BudgetRepository', $arguments);
+ return $repository;
}
);
}
diff --git a/app/Providers/CategoryServiceProvider.php b/app/Providers/CategoryServiceProvider.php
index a3deb55f30..bdac9c91f1 100644
--- a/app/Providers/CategoryServiceProvider.php
+++ b/app/Providers/CategoryServiceProvider.php
@@ -14,7 +14,8 @@ declare(strict_types = 1);
namespace FireflyIII\Providers;
-use FireflyIII\Exceptions\FireflyException;
+use FireflyIII\Repositories\Category\CategoryRepository;
+use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
@@ -43,16 +44,15 @@ class CategoryServiceProvider extends ServiceProvider
public function register()
{
$this->app->bind(
- 'FireflyIII\Repositories\Category\CategoryRepositoryInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Repositories\Category\CategoryRepository', [auth()->user()]);
- }
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
+ CategoryRepositoryInterface::class,
+ function (Application $app) {
+ /** @var CategoryRepository $repository */
+ $repository = app(CategoryRepository::class);
+ if ($app->auth->check()) {
+ $repository->setUser(auth()->user());
}
- return app('FireflyIII\Repositories\Category\CategoryRepository', $arguments);
+ return $repository;
}
);
diff --git a/app/Providers/CrudServiceProvider.php b/app/Providers/CrudServiceProvider.php
deleted file mode 100644
index 93acfa1412..0000000000
--- a/app/Providers/CrudServiceProvider.php
+++ /dev/null
@@ -1,64 +0,0 @@
-registerJournal();
- }
-
- private function registerJournal()
- {
- $this->app->bind(
- 'FireflyIII\Crud\Split\JournalInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Crud\Split\Journal', [auth()->user()]);
- }
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
- }
-
- return app('FireflyIII\Crud\Split\Journal', $arguments);
- }
- );
-
- }
-}
diff --git a/app/Providers/CurrencyServiceProvider.php b/app/Providers/CurrencyServiceProvider.php
index d95532e072..bfdf535c70 100644
--- a/app/Providers/CurrencyServiceProvider.php
+++ b/app/Providers/CurrencyServiceProvider.php
@@ -14,7 +14,8 @@ declare(strict_types = 1);
namespace FireflyIII\Providers;
-use FireflyIII\Exceptions\FireflyException;
+use FireflyIII\Repositories\Currency\CurrencyRepository;
+use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
@@ -43,16 +44,15 @@ class CurrencyServiceProvider extends ServiceProvider
public function register()
{
$this->app->bind(
- 'FireflyIII\Repositories\Currency\CurrencyRepositoryInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Repositories\Currency\CurrencyRepository', [auth()->user()]);
- }
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
+ CurrencyRepositoryInterface::class,
+ function (Application $app) {
+ /** @var CurrencyRepository $repository */
+ $repository = app(CurrencyRepository::class);
+ if ($app->auth->check()) {
+ $repository->setUser(auth()->user());
}
- return app('FireflyIII\Repositories\Currency\CurrencyRepository', $arguments);
+ return $repository;
}
);
}
diff --git a/app/Providers/ExportJobServiceProvider.php b/app/Providers/ExportJobServiceProvider.php
index 220a678623..6850f417b5 100644
--- a/app/Providers/ExportJobServiceProvider.php
+++ b/app/Providers/ExportJobServiceProvider.php
@@ -14,7 +14,10 @@ declare(strict_types = 1);
namespace FireflyIII\Providers;
-use FireflyIII\Exceptions\FireflyException;
+use FireflyIII\Repositories\ExportJob\ExportJobRepository;
+use FireflyIII\Repositories\ExportJob\ExportJobRepositoryInterface;
+use FireflyIII\Repositories\ImportJob\ImportJobRepository;
+use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
@@ -33,8 +36,7 @@ class ExportJobServiceProvider extends ServiceProvider
*/
public function boot()
{
- $this->exportJob();
- $this->importJob();
+
}
@@ -45,7 +47,8 @@ class ExportJobServiceProvider extends ServiceProvider
*/
public function register()
{
- //
+ $this->exportJob();
+ $this->importJob();
}
/**
@@ -53,18 +56,16 @@ class ExportJobServiceProvider extends ServiceProvider
*/
private function exportJob()
{
-
$this->app->bind(
- 'FireflyIII\Repositories\ExportJob\ExportJobRepositoryInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Repositories\ExportJob\ExportJobRepository', [auth()->user()]);
- }
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
+ ExportJobRepositoryInterface::class,
+ function (Application $app) {
+ /** @var ExportJobRepository $repository */
+ $repository = app(ExportJobRepository::class);
+ if ($app->auth->check()) {
+ $repository->setUser(auth()->user());
}
- return app('FireflyIII\Repositories\ExportJob\ExportJobRepository', $arguments);
+ return $repository;
}
);
}
@@ -72,16 +73,15 @@ class ExportJobServiceProvider extends ServiceProvider
private function importJob()
{
$this->app->bind(
- 'FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Repositories\ImportJob\ImportJobRepository', [auth()->user()]);
- }
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
+ ImportJobRepositoryInterface::class,
+ function (Application $app) {
+ /** @var ImportJobRepository $repository */
+ $repository = app(ImportJobRepository::class);
+ if ($app->auth->check()) {
+ $repository->setUser(auth()->user());
}
- return app('FireflyIII\Repositories\ImportJob\ImportJobRepository', $arguments);
+ return $repository;
}
);
}
diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php
index b798f531e0..2ef97e48d2 100644
--- a/app/Providers/FireflyServiceProvider.php
+++ b/app/Providers/FireflyServiceProvider.php
@@ -13,6 +13,28 @@ declare(strict_types = 1);
namespace FireflyIII\Providers;
+use FireflyIII\Export\Processor;
+use FireflyIII\Export\ProcessorInterface;
+use FireflyIII\Generator\Chart\Basic\ChartJsGenerator;
+use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
+use FireflyIII\Helpers\Attachments\AttachmentHelper;
+use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
+use FireflyIII\Helpers\Chart\MetaPieChart;
+use FireflyIII\Helpers\Chart\MetaPieChartInterface;
+use FireflyIII\Helpers\FiscalHelper;
+use FireflyIII\Helpers\FiscalHelperInterface;
+use FireflyIII\Helpers\Help\Help;
+use FireflyIII\Helpers\Help\HelpInterface;
+use FireflyIII\Helpers\Report\BalanceReportHelper;
+use FireflyIII\Helpers\Report\BalanceReportHelperInterface;
+use FireflyIII\Helpers\Report\BudgetReportHelper;
+use FireflyIII\Helpers\Report\BudgetReportHelperInterface;
+use FireflyIII\Helpers\Report\ReportHelper;
+use FireflyIII\Helpers\Report\ReportHelperInterface;
+use FireflyIII\Import\ImportProcedure;
+use FireflyIII\Import\ImportProcedureInterface;
+use FireflyIII\Repositories\User\UserRepository;
+use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\Support\Amount;
use FireflyIII\Support\ExpandedForm;
use FireflyIII\Support\FireflyConfig;
@@ -94,22 +116,22 @@ class FireflyServiceProvider extends ServiceProvider
);
// chart generator:
- $this->app->bind('FireflyIII\Generator\Chart\Basic\GeneratorInterface', 'FireflyIII\Generator\Chart\Basic\ChartJsGenerator');
+ $this->app->bind(GeneratorInterface::class, ChartJsGenerator::class);
// chart builder
- $this->app->bind('FireflyIII\Helpers\Chart\MetaPieChartInterface', 'FireflyIII\Helpers\Chart\MetaPieChart');
+ $this->app->bind(MetaPieChartInterface::class, MetaPieChart::class);
// other generators
- $this->app->bind('FireflyIII\Export\ProcessorInterface', 'FireflyIII\Export\Processor');
- $this->app->bind('FireflyIII\Import\ImportProcedureInterface', 'FireflyIII\Import\ImportProcedure');
- $this->app->bind('FireflyIII\Repositories\User\UserRepositoryInterface', 'FireflyIII\Repositories\User\UserRepository');
- $this->app->bind('FireflyIII\Helpers\Attachments\AttachmentHelperInterface', 'FireflyIII\Helpers\Attachments\AttachmentHelper');
+ $this->app->bind(ProcessorInterface::class,Processor::class);
+ $this->app->bind(ImportProcedureInterface::class,ImportProcedure::class);
+ $this->app->bind(UserRepositoryInterface::class, UserRepository::class);
+ $this->app->bind(AttachmentHelperInterface::class, AttachmentHelper::class);
- $this->app->bind('FireflyIII\Helpers\Help\HelpInterface', 'FireflyIII\Helpers\Help\Help');
- $this->app->bind('FireflyIII\Helpers\Report\ReportHelperInterface', 'FireflyIII\Helpers\Report\ReportHelper');
- $this->app->bind('FireflyIII\Helpers\FiscalHelperInterface', 'FireflyIII\Helpers\FiscalHelper');
- $this->app->bind('FireflyIII\Helpers\Report\BalanceReportHelperInterface', 'FireflyIII\Helpers\Report\BalanceReportHelper');
- $this->app->bind('FireflyIII\Helpers\Report\BudgetReportHelperInterface', 'FireflyIII\Helpers\Report\BudgetReportHelper');
+ $this->app->bind(HelpInterface::class, Help::class);
+ $this->app->bind(ReportHelperInterface::class, ReportHelper::class);
+ $this->app->bind(FiscalHelperInterface::class,FiscalHelper::class);
+ $this->app->bind(BalanceReportHelperInterface::class, BalanceReportHelper::class);
+ $this->app->bind(BudgetReportHelperInterface::class, BudgetReportHelper::class);
}
}
diff --git a/app/Providers/JournalServiceProvider.php b/app/Providers/JournalServiceProvider.php
index 2ac7f61f64..b44c11b760 100644
--- a/app/Providers/JournalServiceProvider.php
+++ b/app/Providers/JournalServiceProvider.php
@@ -14,7 +14,12 @@ declare(strict_types = 1);
namespace FireflyIII\Providers;
-use FireflyIII\Exceptions\FireflyException;
+use FireflyIII\Helpers\Collector\JournalCollector;
+use FireflyIII\Helpers\Collector\JournalCollectorInterface;
+use FireflyIII\Repositories\Journal\JournalRepository;
+use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
+use FireflyIII\Repositories\Journal\JournalTasker;
+use FireflyIII\Repositories\Journal\JournalTaskerInterface;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
@@ -50,16 +55,16 @@ class JournalServiceProvider extends ServiceProvider
private function registerCollector()
{
$this->app->bind(
- 'FireflyIII\Helpers\Collector\JournalCollectorInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Helpers\Collector\JournalCollector', [auth()->user()]);
- }
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
+ JournalCollectorInterface::class,
+ function (Application $app) {
+ /** @var JournalCollectorInterface $collector */
+ $collector = app(JournalCollector::class);
+ if ($app->auth->check()) {
+ $collector->setUser(auth()->user());
}
+ $collector->startQuery();
- return app('FireflyIII\Helpers\Collector\JournalCollector', $arguments);
+ return $collector;
}
);
}
@@ -67,16 +72,16 @@ class JournalServiceProvider extends ServiceProvider
private function registerRepository()
{
$this->app->bind(
- 'FireflyIII\Repositories\Journal\JournalRepositoryInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Repositories\Journal\JournalRepository', [auth()->user()]);
- }
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
+ JournalRepositoryInterface::class,
+ function (Application $app) {
+ /** @var JournalRepositoryInterface $repository */
+ $repository = app(JournalRepository::class);
+ if ($app->auth->check()) {
+
+ $repository->setUser(auth()->user());
}
- return app('FireflyIII\Repositories\Journal\JournalRepository', $arguments);
+ return $repository;
}
);
}
@@ -84,16 +89,16 @@ class JournalServiceProvider extends ServiceProvider
private function registerTasker()
{
$this->app->bind(
- 'FireflyIII\Repositories\Journal\JournalTaskerInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Repositories\Journal\JournalTasker', [auth()->user()]);
- }
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
+ JournalTaskerInterface::class,
+ function (Application $app) {
+ /** @var JournalTaskerInterface $tasker */
+ $tasker = app(JournalTasker::class);
+
+ if ($app->auth->check()) {
+ $tasker->setUser(auth()->user());
}
- return app('FireflyIII\Repositories\Journal\JournalTasker', $arguments);
+ return $tasker;
}
);
}
diff --git a/app/Providers/LogServiceProvider.php b/app/Providers/LogServiceProvider.php
new file mode 100644
index 0000000000..86bf30481f
--- /dev/null
+++ b/app/Providers/LogServiceProvider.php
@@ -0,0 +1,53 @@
+useDailyFiles(
+ $this->app->storagePath() . '/logs/firefly-iii.log', $this->maxFiles(),
+ $this->logLevel()
+ );
+ }
+
+ /**
+ * Configure the Monolog handlers for the application.
+ *
+ * @param \Illuminate\Log\Writer $log
+ *
+ * @return void
+ */
+ protected function configureSingleHandler(Writer $log)
+ {
+ $log->useFiles(
+ $this->app->storagePath() . '/logs/firefly-iii.log',
+ $this->logLevel()
+ );
+ }
+}
\ No newline at end of file
diff --git a/app/Providers/PiggyBankServiceProvider.php b/app/Providers/PiggyBankServiceProvider.php
index 11ba540e3c..fb1aaf7d5f 100644
--- a/app/Providers/PiggyBankServiceProvider.php
+++ b/app/Providers/PiggyBankServiceProvider.php
@@ -15,6 +15,8 @@ declare(strict_types = 1);
namespace FireflyIII\Providers;
use FireflyIII\Exceptions\FireflyException;
+use FireflyIII\Repositories\PiggyBank\PiggyBankRepository;
+use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
@@ -44,16 +46,14 @@ class PiggyBankServiceProvider extends ServiceProvider
public function register()
{
$this->app->bind(
- 'FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Repositories\PiggyBank\PiggyBankRepository', [auth()->user()]);
+ PiggyBankRepositoryInterface::class,
+ function (Application $app) {
+ /** @var PiggyBankRepository $repository */
+ $repository = app(PiggyBankRepository::class);
+ if ($app->auth->check()) {
+ $repository->setUser(auth()->user());
}
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
- }
-
- return app('FireflyIII\Repositories\PiggyBank\PiggyBankRepository', $arguments);
+ return $repository;
}
);
}
diff --git a/app/Providers/RuleGroupServiceProvider.php b/app/Providers/RuleGroupServiceProvider.php
index bddd6a8480..0a3c8db599 100644
--- a/app/Providers/RuleGroupServiceProvider.php
+++ b/app/Providers/RuleGroupServiceProvider.php
@@ -14,7 +14,8 @@ declare(strict_types = 1);
namespace FireflyIII\Providers;
-use FireflyIII\Exceptions\FireflyException;
+use FireflyIII\Repositories\RuleGroup\RuleGroupRepository;
+use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
@@ -44,16 +45,15 @@ class RuleGroupServiceProvider extends ServiceProvider
public function register()
{
$this->app->bind(
- 'FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Repositories\RuleGroup\RuleGroupRepository', [auth()->user()]);
- }
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
+ RuleGroupRepositoryInterface::class,
+ function (Application $app) {
+ /** @var RuleGroupRepository $repository */
+ $repository = app(RuleGroupRepository::class);
+ if ($app->auth->check()) {
+ $repository->setUser(auth()->user());
}
- return app('FireflyIII\Repositories\RuleGroup\RuleGroupRepository', $arguments);
+ return $repository;
}
);
}
diff --git a/app/Providers/RuleServiceProvider.php b/app/Providers/RuleServiceProvider.php
index a395e8cda3..5d694411b3 100644
--- a/app/Providers/RuleServiceProvider.php
+++ b/app/Providers/RuleServiceProvider.php
@@ -14,7 +14,8 @@ declare(strict_types = 1);
namespace FireflyIII\Providers;
-use FireflyIII\Exceptions\FireflyException;
+use FireflyIII\Repositories\Rule\RuleRepository;
+use FireflyIII\Repositories\Rule\RuleRepositoryInterface;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
@@ -43,16 +44,14 @@ class RuleServiceProvider extends ServiceProvider
public function register()
{
$this->app->bind(
- 'FireflyIII\Repositories\Rule\RuleRepositoryInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Repositories\Rule\RuleRepository', [auth()->user()]);
+ RuleRepositoryInterface::class,
+ function (Application $app) {
+ /** @var RuleRepository $repository */
+ $repository = app(RuleRepository::class);
+ if ($app->auth->check()) {
+ $repository->setUser(auth()->user());
}
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
- }
-
- return app('FireflyIII\Repositories\Rule\RuleRepository', $arguments);
+ return $repository;
}
);
}
diff --git a/app/Providers/SearchServiceProvider.php b/app/Providers/SearchServiceProvider.php
index a7be767e5e..18d5b48c6e 100644
--- a/app/Providers/SearchServiceProvider.php
+++ b/app/Providers/SearchServiceProvider.php
@@ -14,7 +14,8 @@ declare(strict_types = 1);
namespace FireflyIII\Providers;
-use FireflyIII\Exceptions\FireflyException;
+use FireflyIII\Support\Search\Search;
+use FireflyIII\Support\Search\SearchInterface;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
@@ -43,16 +44,15 @@ class SearchServiceProvider extends ServiceProvider
public function register()
{
$this->app->bind(
- 'FireflyIII\Support\Search\SearchInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Support\Search\Search', [auth()->user()]);
- }
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
+ SearchInterface::class,
+ function (Application $app) {
+ /** @var Search $search */
+ $search = app(Search::class);
+ if ($app->auth->check()) {
+ $search->setUser(auth()->user());
}
- return app('FireflyIII\Support\Search\Search', $arguments);
+ return $search;
}
);
}
diff --git a/app/Providers/TagServiceProvider.php b/app/Providers/TagServiceProvider.php
index 8889c9fbeb..b5daa36c6c 100644
--- a/app/Providers/TagServiceProvider.php
+++ b/app/Providers/TagServiceProvider.php
@@ -14,7 +14,8 @@ declare(strict_types = 1);
namespace FireflyIII\Providers;
-use FireflyIII\Exceptions\FireflyException;
+use FireflyIII\Repositories\Tag\TagRepository;
+use FireflyIII\Repositories\Tag\TagRepositoryInterface;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;
@@ -43,16 +44,16 @@ class TagServiceProvider extends ServiceProvider
public function register()
{
$this->app->bind(
- 'FireflyIII\Repositories\Tag\TagRepositoryInterface',
- function (Application $app, array $arguments) {
- if (!isset($arguments[0]) && $app->auth->check()) {
- return app('FireflyIII\Repositories\Tag\TagRepository', [auth()->user()]);
- }
- if (!isset($arguments[0]) && !$app->auth->check()) {
- throw new FireflyException('There is no user present.');
+ TagRepositoryInterface::class,
+ function (Application $app) {
+ /** @var TagRepository $repository */
+ $repository = app(TagRepository::class);
+
+ if ($app->auth->check()) {
+ $repository->setUser(auth()->user());
}
- return app('FireflyIII\Repositories\Tag\TagRepository', $arguments);
+ return $repository;
}
);
}
diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php
index d740291f68..26ba26b6ea 100644
--- a/app/Repositories/Account/AccountRepository.php
+++ b/app/Repositories/Account/AccountRepository.php
@@ -43,16 +43,6 @@ class AccountRepository implements AccountRepositoryInterface
/** @var array */
private $validFields = ['accountRole', 'ccMonthlyPaymentDate', 'ccType', 'accountNumber', 'currency_id', 'BIC'];
- /**
- * AttachmentRepository constructor.
- *
- * @param User $user
- */
- public function __construct(User $user)
- {
- $this->user = $user;
- }
-
/**
* Moved here from account CRUD
*
@@ -323,6 +313,14 @@ class AccountRepository implements AccountRepositoryInterface
return $journal->date;
}
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user)
+ {
+ $this->user = $user;
+ }
+
/**
* @param array $data
*
diff --git a/app/Repositories/Account/AccountRepositoryInterface.php b/app/Repositories/Account/AccountRepositoryInterface.php
index 428e48144d..b0ab9b738b 100644
--- a/app/Repositories/Account/AccountRepositoryInterface.php
+++ b/app/Repositories/Account/AccountRepositoryInterface.php
@@ -16,6 +16,7 @@ namespace FireflyIII\Repositories\Account;
use Carbon\Carbon;
use FireflyIII\Models\Account;
use FireflyIII\Models\TransactionJournal;
+use FireflyIII\User;
use Illuminate\Support\Collection;
/**
@@ -124,6 +125,11 @@ interface AccountRepositoryInterface
*/
public function oldestJournalDate(Account $account): Carbon;
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user);
+
/**
* @param array $data
*
diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.php
index 126d084e8d..d43902e094 100644
--- a/app/Repositories/Account/AccountTasker.php
+++ b/app/Repositories/Account/AccountTasker.php
@@ -31,16 +31,6 @@ class AccountTasker implements AccountTaskerInterface
/** @var User */
private $user;
- /**
- * AttachmentRepository constructor.
- *
- * @param User $user
- */
- public function __construct(User $user)
- {
- $this->user = $user;
- }
-
/**
* @see self::amountInPeriod
*
@@ -108,8 +98,8 @@ class AccountTasker implements AccountTaskerInterface
*/
public function getAccountReport(Collection $accounts, Carbon $start, Carbon $end): array
{
- $ids = $accounts->pluck('id')->toArray();
- $yesterday = clone $start;
+ $ids = $accounts->pluck('id')->toArray();
+ $yesterday = clone $start;
$yesterday->subDay();
$startSet = Steam::balancesById($ids, $yesterday);
$endSet = Steam::balancesById($ids, $end);
@@ -155,6 +145,14 @@ class AccountTasker implements AccountTaskerInterface
return $return;
}
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user)
+ {
+ $this->user = $user;
+ }
+
/**
* Will return how much money has been going out (ie. spent) by the given account(s).
* Alternatively, will return how much money has been coming in (ie. earned) by the given accounts.
diff --git a/app/Repositories/Account/AccountTaskerInterface.php b/app/Repositories/Account/AccountTaskerInterface.php
index 57fbebaa79..4ea5be74ef 100644
--- a/app/Repositories/Account/AccountTaskerInterface.php
+++ b/app/Repositories/Account/AccountTaskerInterface.php
@@ -14,6 +14,7 @@ declare(strict_types = 1);
namespace FireflyIII\Repositories\Account;
use Carbon\Carbon;
+use FireflyIII\User;
use Illuminate\Support\Collection;
/**
@@ -23,7 +24,6 @@ use Illuminate\Support\Collection;
*/
interface AccountTaskerInterface
{
-
/**
* @param Collection $accounts
* @param Collection $excluded
@@ -57,4 +57,9 @@ interface AccountTaskerInterface
*/
public function getAccountReport(Collection $accounts, Carbon $start, Carbon $end): array;
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user);
+
}
diff --git a/app/Repositories/Attachment/AttachmentRepository.php b/app/Repositories/Attachment/AttachmentRepository.php
index 1bc9401624..79a481e4ab 100644
--- a/app/Repositories/Attachment/AttachmentRepository.php
+++ b/app/Repositories/Attachment/AttachmentRepository.php
@@ -14,12 +14,12 @@ declare(strict_types = 1);
namespace FireflyIII\Repositories\Attachment;
use Carbon\Carbon;
+use Crypt;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Models\Attachment;
use FireflyIII\User;
use Illuminate\Support\Collection;
use Storage;
-use Crypt;
/**
* Class AttachmentRepository
@@ -31,16 +31,6 @@ class AttachmentRepository implements AttachmentRepositoryInterface
/** @var User */
private $user;
- /**
- * AttachmentRepository constructor.
- *
- * @param User $user
- */
- public function __construct(User $user)
- {
- $this->user = $user;
- }
-
/**
* @param Attachment $attachment
*
@@ -117,6 +107,14 @@ class AttachmentRepository implements AttachmentRepositoryInterface
return '';
}
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user)
+ {
+ $this->user = $user;
+ }
+
/**
* @param Attachment $attachment
* @param array $data
diff --git a/app/Repositories/Attachment/AttachmentRepositoryInterface.php b/app/Repositories/Attachment/AttachmentRepositoryInterface.php
index 9e12092c70..cc7cb887f8 100644
--- a/app/Repositories/Attachment/AttachmentRepositoryInterface.php
+++ b/app/Repositories/Attachment/AttachmentRepositoryInterface.php
@@ -15,6 +15,7 @@ namespace FireflyIII\Repositories\Attachment;
use Carbon\Carbon;
use FireflyIII\Models\Attachment;
+use FireflyIII\User;
use Illuminate\Support\Collection;
/**
@@ -59,6 +60,11 @@ interface AttachmentRepositoryInterface
*/
public function getContent(Attachment $attachment): string;
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user);
+
/**
* @param Attachment $attachment
* @param array $attachmentData
diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php
index d3bfa01572..545a29fb96 100644
--- a/app/Repositories/Bill/BillRepository.php
+++ b/app/Repositories/Bill/BillRepository.php
@@ -37,16 +37,6 @@ class BillRepository implements BillRepositoryInterface
/** @var User */
private $user;
- /**
- * BillRepository constructor.
- *
- * @param User $user
- */
- public function __construct(User $user)
- {
- $this->user = $user;
- }
-
/**
* @param Bill $bill
*
@@ -520,6 +510,14 @@ class BillRepository implements BillRepositoryInterface
}
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user)
+ {
+ $this->user = $user;
+ }
+
/**
* @param array $data
*
diff --git a/app/Repositories/Bill/BillRepositoryInterface.php b/app/Repositories/Bill/BillRepositoryInterface.php
index c2c6cd223d..2e07d12d93 100644
--- a/app/Repositories/Bill/BillRepositoryInterface.php
+++ b/app/Repositories/Bill/BillRepositoryInterface.php
@@ -16,6 +16,7 @@ namespace FireflyIII\Repositories\Bill;
use Carbon\Carbon;
use FireflyIII\Models\Bill;
use FireflyIII\Models\TransactionJournal;
+use FireflyIII\User;
use Illuminate\Support\Collection;
/**
@@ -25,7 +26,6 @@ use Illuminate\Support\Collection;
*/
interface BillRepositoryInterface
{
-
/**
* @param Bill $bill
*
@@ -159,6 +159,11 @@ interface BillRepositoryInterface
*/
public function scan(Bill $bill, TransactionJournal $journal): bool;
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user);
+
/**
* @param array $data
*
diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php
index 7c8d2f6391..9b4f985390 100644
--- a/app/Repositories/Budget/BudgetRepository.php
+++ b/app/Repositories/Budget/BudgetRepository.php
@@ -38,16 +38,6 @@ class BudgetRepository implements BudgetRepositoryInterface
/** @var User */
private $user;
- /**
- * BudgetRepository constructor.
- *
- * @param User $user
- */
- public function __construct(User $user)
- {
- $this->user = $user;
- }
-
/**
* @return bool
*/
@@ -433,6 +423,14 @@ class BudgetRepository implements BudgetRepositoryInterface
return true;
}
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user)
+ {
+ $this->user = $user;
+ }
+
/**
* @param Collection $budgets
* @param Collection $accounts
@@ -444,7 +442,8 @@ class BudgetRepository implements BudgetRepositoryInterface
public function spentInPeriod(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end): string
{
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [$this->user]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser($this->user);
$collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setBudgets($budgets);
if ($accounts->count() > 0) {
@@ -470,7 +469,8 @@ class BudgetRepository implements BudgetRepositoryInterface
public function spentInPeriodWoBudget(Collection $accounts, Carbon $start, Carbon $end): string
{
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [$this->user]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser($this->user);
$collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->withoutBudget();
if ($accounts->count() > 0) {
diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php
index ee9eba1641..906a4827ae 100644
--- a/app/Repositories/Budget/BudgetRepositoryInterface.php
+++ b/app/Repositories/Budget/BudgetRepositoryInterface.php
@@ -17,6 +17,7 @@ use Carbon\Carbon;
use FireflyIII\Models\Budget;
use FireflyIII\Models\BudgetLimit;
use FireflyIII\Models\TransactionCurrency;
+use FireflyIII\User;
use Illuminate\Support\Collection;
/**
@@ -26,7 +27,6 @@ use Illuminate\Support\Collection;
*/
interface BudgetRepositoryInterface
{
-
/**
* @return bool
*/
@@ -149,6 +149,11 @@ interface BudgetRepositoryInterface
*/
public function setAvailableBudget(TransactionCurrency $currency, Carbon $start, Carbon $end, string $amount): bool;
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user);
+
/**
* @param Collection $budgets
* @param Collection $accounts
diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php
index 32c2eb2135..bed2d5847f 100644
--- a/app/Repositories/Category/CategoryRepository.php
+++ b/app/Repositories/Category/CategoryRepository.php
@@ -34,16 +34,6 @@ class CategoryRepository implements CategoryRepositoryInterface
/** @var User */
private $user;
- /**
- * CategoryRepository constructor.
- *
- * @param User $user
- */
- public function __construct(User $user)
- {
- $this->user = $user;
- }
-
/**
* @param Category $category
*
@@ -67,7 +57,8 @@ class CategoryRepository implements CategoryRepositoryInterface
public function earnedInPeriod(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): string
{
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [$this->user]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser($this->user);
$collector->setRange($start, $end)->setTypes([TransactionType::DEPOSIT])->setAccounts($accounts)->setCategories($categories);
$set = $collector->getJournals();
$sum = strval($set->sum('transaction_amount'));
@@ -384,6 +375,14 @@ class CategoryRepository implements CategoryRepositoryInterface
return $result;
}
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user)
+ {
+ $this->user = $user;
+ }
+
/**
* @param Collection $categories
* @param Collection $accounts
@@ -395,7 +394,8 @@ class CategoryRepository implements CategoryRepositoryInterface
public function spentInPeriod(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): string
{
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [$this->user]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser($this->user);
$collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setCategories($categories);
@@ -423,7 +423,8 @@ class CategoryRepository implements CategoryRepositoryInterface
public function spentInPeriodWithoutCategory(Collection $accounts, Carbon $start, Carbon $end): string
{
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [$this->user]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser($this->user);
$collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->withoutCategory();
if ($accounts->count() > 0) {
diff --git a/app/Repositories/Category/CategoryRepositoryInterface.php b/app/Repositories/Category/CategoryRepositoryInterface.php
index 1194fbbf74..9e89a78f50 100644
--- a/app/Repositories/Category/CategoryRepositoryInterface.php
+++ b/app/Repositories/Category/CategoryRepositoryInterface.php
@@ -15,6 +15,7 @@ namespace FireflyIII\Repositories\Category;
use Carbon\Carbon;
use FireflyIII\Models\Category;
+use FireflyIII\User;
use Illuminate\Support\Collection;
/**
@@ -121,6 +122,11 @@ interface CategoryRepositoryInterface
*/
public function periodIncomeNoCategory(Collection $accounts, Carbon $start, Carbon $end): array;
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user);
+
/**
* @param Collection $categories
* @param Collection $accounts
diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php
index d2eaed1c30..bb1444d73c 100644
--- a/app/Repositories/Currency/CurrencyRepository.php
+++ b/app/Repositories/Currency/CurrencyRepository.php
@@ -31,11 +31,9 @@ class CurrencyRepository implements CurrencyRepositoryInterface
private $user;
/**
- * CategoryRepository constructor.
- *
* @param User $user
*/
- public function __construct(User $user)
+ public function setUser(User $user)
{
$this->user = $user;
}
diff --git a/app/Repositories/Currency/CurrencyRepositoryInterface.php b/app/Repositories/Currency/CurrencyRepositoryInterface.php
index 4ccebe40b0..63eb9bf0b5 100644
--- a/app/Repositories/Currency/CurrencyRepositoryInterface.php
+++ b/app/Repositories/Currency/CurrencyRepositoryInterface.php
@@ -16,6 +16,7 @@ namespace FireflyIII\Repositories\Currency;
use FireflyIII\Models\Preference;
use FireflyIII\Models\TransactionCurrency;
+use FireflyIII\User;
use Illuminate\Support\Collection;
/**
@@ -94,6 +95,11 @@ interface CurrencyRepositoryInterface
*/
public function getCurrencyByPreference(Preference $preference): TransactionCurrency;
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user);
+
/**
* @param array $data
*
diff --git a/app/Repositories/ExportJob/ExportJobRepository.php b/app/Repositories/ExportJob/ExportJobRepository.php
index b83818284a..aa956f901e 100644
--- a/app/Repositories/ExportJob/ExportJobRepository.php
+++ b/app/Repositories/ExportJob/ExportJobRepository.php
@@ -29,16 +29,6 @@ class ExportJobRepository implements ExportJobRepositoryInterface
/** @var User */
private $user;
- /**
- * ExportJobRepository constructor.
- *
- * @param User $user
- */
- public function __construct(User $user)
- {
- $this->user = $user;
- }
-
/**
* @param ExportJob $job
* @param string $status
@@ -149,4 +139,12 @@ class ExportJobRepository implements ExportJobRepositoryInterface
return $content;
}
+
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user)
+ {
+ $this->user = $user;
+ }
}
diff --git a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php
index 6f3c7a30b1..7e93663ea5 100644
--- a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php
+++ b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php
@@ -14,6 +14,7 @@ declare(strict_types = 1);
namespace FireflyIII\Repositories\ExportJob;
use FireflyIII\Models\ExportJob;
+use FireflyIII\User;
/**
* Interface ExportJobRepositoryInterface
@@ -61,4 +62,9 @@ interface ExportJobRepositoryInterface
*/
public function getContent(ExportJob $job): string;
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user);
+
}
diff --git a/app/Repositories/ImportJob/ImportJobRepository.php b/app/Repositories/ImportJob/ImportJobRepository.php
index d7f4ac30cf..0eec759e5b 100644
--- a/app/Repositories/ImportJob/ImportJobRepository.php
+++ b/app/Repositories/ImportJob/ImportJobRepository.php
@@ -28,16 +28,6 @@ class ImportJobRepository implements ImportJobRepositoryInterface
/** @var User */
private $user;
- /**
- * ExportJobRepository constructor.
- *
- * @param User $user
- */
- public function __construct(User $user)
- {
- $this->user = $user;
- }
-
/**
* @param string $fileType
*
@@ -95,4 +85,12 @@ class ImportJobRepository implements ImportJobRepositoryInterface
return $result;
}
+
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user)
+ {
+ $this->user = $user;
+ }
}
diff --git a/app/Repositories/ImportJob/ImportJobRepositoryInterface.php b/app/Repositories/ImportJob/ImportJobRepositoryInterface.php
index a17d9ca62c..5bb2149fbe 100644
--- a/app/Repositories/ImportJob/ImportJobRepositoryInterface.php
+++ b/app/Repositories/ImportJob/ImportJobRepositoryInterface.php
@@ -14,6 +14,7 @@ declare(strict_types = 1);
namespace FireflyIII\Repositories\ImportJob;
use FireflyIII\Models\ImportJob;
+use FireflyIII\User;
/**
* Interface ImportJobRepositoryInterface
@@ -35,4 +36,9 @@ interface ImportJobRepositoryInterface
* @return ImportJob
*/
public function findByKey(string $key): ImportJob;
+
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user);
}
diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php
index 9ee336cddf..12ce898ff1 100644
--- a/app/Repositories/Journal/JournalRepository.php
+++ b/app/Repositories/Journal/JournalRepository.php
@@ -44,11 +44,9 @@ class JournalRepository implements JournalRepositoryInterface
private $validMetaFields = ['interest_date', 'book_date', 'process_date', 'due_date', 'payment_date', 'invoice_date', 'internal_reference', 'notes'];
/**
- * JournalRepository constructor.
- *
* @param User $user
*/
- public function __construct(User $user)
+ public function setUser(User $user)
{
$this->user = $user;
}
diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.php
index 0b62a5729a..f1f5438ad4 100644
--- a/app/Repositories/Journal/JournalRepositoryInterface.php
+++ b/app/Repositories/Journal/JournalRepositoryInterface.php
@@ -16,6 +16,7 @@ namespace FireflyIII\Repositories\Journal;
use FireflyIII\Models\Account;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionType;
+use FireflyIII\User;
use Illuminate\Support\Collection;
use Illuminate\Support\MessageBag;
@@ -26,7 +27,6 @@ use Illuminate\Support\MessageBag;
*/
interface JournalRepositoryInterface
{
-
/**
* @param TransactionJournal $journal
* @param TransactionType $type
@@ -37,11 +37,6 @@ interface JournalRepositoryInterface
*/
public function convert(TransactionJournal $journal, TransactionType $type, Account $source, Account $destination): MessageBag;
- /**
- * @return Collection
- */
- public function getTransactionTypes(): Collection;
-
/**
* Deletes a journal.
*
@@ -67,6 +62,15 @@ interface JournalRepositoryInterface
*/
public function first(): TransactionJournal;
+ /**
+ * @return Collection
+ */
+ public function getTransactionTypes(): Collection;
+
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user);
/**
* @param array $data
diff --git a/app/Repositories/Journal/JournalTasker.php b/app/Repositories/Journal/JournalTasker.php
index eb77c77e6f..c0424242c8 100644
--- a/app/Repositories/Journal/JournalTasker.php
+++ b/app/Repositories/Journal/JournalTasker.php
@@ -35,15 +35,6 @@ class JournalTasker implements JournalTaskerInterface
/** @var User */
private $user;
- /**
- * JournalRepository constructor.
- *
- * @param User $user
- */
- public function __construct(User $user)
- {
- $this->user = $user;
- }
/**
* @param TransactionJournal $journal
@@ -152,6 +143,14 @@ class JournalTasker implements JournalTaskerInterface
return $transactions;
}
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user)
+ {
+ $this->user = $user;
+ }
+
/**
* Collect the balance of an account before the given transaction has hit. This is tricky, because
* the balance does not depend on the transaction itself but the journal it's part of. And of course
diff --git a/app/Repositories/Journal/JournalTaskerInterface.php b/app/Repositories/Journal/JournalTaskerInterface.php
index 058bc63733..1273f69c3a 100644
--- a/app/Repositories/Journal/JournalTaskerInterface.php
+++ b/app/Repositories/Journal/JournalTaskerInterface.php
@@ -15,6 +15,7 @@ namespace FireflyIII\Repositories\Journal;
use FireflyIII\Models\TransactionJournal;
+use FireflyIII\User;
use Illuminate\Support\Collection;
/**
@@ -24,7 +25,6 @@ use Illuminate\Support\Collection;
*/
interface JournalTaskerInterface
{
-
/**
* @param TransactionJournal $journal
*
@@ -41,4 +41,9 @@ interface JournalTaskerInterface
* @return array
*/
public function getTransactionsOverview(TransactionJournal $journal): array;
+
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user);
}
diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php
index 5a9f07704c..1f14467a5b 100644
--- a/app/Repositories/PiggyBank/PiggyBankRepository.php
+++ b/app/Repositories/PiggyBank/PiggyBankRepository.php
@@ -32,16 +32,6 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
/** @var User */
private $user;
- /**
- * PiggyBankRepository constructor.
- *
- * @param User $user
- */
- public function __construct(User $user)
- {
- $this->user = $user;
- }
-
/**
* @param PiggyBank $piggyBank
* @param string $amount
@@ -167,6 +157,14 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
return true;
}
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user)
+ {
+ $this->user = $user;
+ }
+
/**
* @param array $data
*
diff --git a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php
index aae01702d7..a2da326d86 100644
--- a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php
+++ b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php
@@ -15,6 +15,7 @@ namespace FireflyIII\Repositories\PiggyBank;
use FireflyIII\Models\PiggyBank;
use FireflyIII\Models\PiggyBankEvent;
+use FireflyIII\User;
use Illuminate\Support\Collection;
/**
@@ -98,6 +99,10 @@ interface PiggyBankRepositoryInterface
*/
public function setOrder(int $piggyBankId, int $order): bool;
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user);
/**
* Store new piggy bank.
diff --git a/app/Repositories/Rule/RuleRepository.php b/app/Repositories/Rule/RuleRepository.php
index 4b7ce00433..7e0487be63 100644
--- a/app/Repositories/Rule/RuleRepository.php
+++ b/app/Repositories/Rule/RuleRepository.php
@@ -30,16 +30,6 @@ class RuleRepository implements RuleRepositoryInterface
/** @var User */
private $user;
- /**
- * BillRepository constructor.
- *
- * @param User $user
- */
- public function __construct(User $user)
- {
- $this->user = $user;
- }
-
/**
* @return int
*/
@@ -218,6 +208,14 @@ class RuleRepository implements RuleRepositoryInterface
}
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user)
+ {
+ $this->user = $user;
+ }
+
/**
* @param array $data
*
diff --git a/app/Repositories/Rule/RuleRepositoryInterface.php b/app/Repositories/Rule/RuleRepositoryInterface.php
index 518417d94a..6ca1456214 100644
--- a/app/Repositories/Rule/RuleRepositoryInterface.php
+++ b/app/Repositories/Rule/RuleRepositoryInterface.php
@@ -17,6 +17,7 @@ use FireflyIII\Models\Rule;
use FireflyIII\Models\RuleAction;
use FireflyIII\Models\RuleGroup;
use FireflyIII\Models\RuleTrigger;
+use FireflyIII\User;
/**
* Interface RuleRepositoryInterface
@@ -25,7 +26,6 @@ use FireflyIII\Models\RuleTrigger;
*/
interface RuleRepositoryInterface
{
-
/**
* @return int
*/
@@ -94,6 +94,11 @@ interface RuleRepositoryInterface
*/
public function resetRulesInGroupOrder(RuleGroup $ruleGroup): bool;
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user);
+
/**
* @param array $data
*
diff --git a/app/Repositories/RuleGroup/RuleGroupRepository.php b/app/Repositories/RuleGroup/RuleGroupRepository.php
index b294e19937..e413987334 100644
--- a/app/Repositories/RuleGroup/RuleGroupRepository.php
+++ b/app/Repositories/RuleGroup/RuleGroupRepository.php
@@ -31,11 +31,9 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface
private $user;
/**
- * BillRepository constructor.
- *
* @param User $user
*/
- public function __construct(User $user)
+ public function setUser(User $user)
{
$this->user = $user;
}
diff --git a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php
index 985a121b92..c365fca704 100644
--- a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php
+++ b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php
@@ -26,7 +26,6 @@ use Illuminate\Support\Collection;
interface RuleGroupRepositoryInterface
{
-
/**
*
*
@@ -92,6 +91,11 @@ interface RuleGroupRepositoryInterface
*/
public function resetRulesInGroupOrder(RuleGroup $ruleGroup): bool;
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user);
+
/**
* @param array $data
*
diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php
index 8145be1151..9f91816252 100644
--- a/app/Repositories/Tag/TagRepository.php
+++ b/app/Repositories/Tag/TagRepository.php
@@ -35,11 +35,9 @@ class TagRepository implements TagRepositoryInterface
private $user;
/**
- * TagRepository constructor.
- *
* @param User $user
*/
- public function __construct(User $user)
+ public function setUser(User $user)
{
$this->user = $user;
}
@@ -396,7 +394,8 @@ class TagRepository implements TagRepositoryInterface
public function earnedInPeriod(Tag $tag, Carbon $start, Carbon $end): string
{
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [$this->user]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser($this->user);
$collector->setRange($start, $end)->setTypes([TransactionType::DEPOSIT])->setAllAssetAccounts()->setTag($tag);
$set = $collector->getJournals();
$sum = strval($set->sum('transaction_amount'));
@@ -414,7 +413,8 @@ class TagRepository implements TagRepositoryInterface
public function spentInPeriod(Tag $tag, Carbon $start, Carbon $end): string
{
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [$this->user]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser($this->user);
$collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setAllAssetAccounts()->setTag($tag);
$set = $collector->getJournals();
$sum = strval($set->sum('transaction_amount'));
diff --git a/app/Repositories/Tag/TagRepositoryInterface.php b/app/Repositories/Tag/TagRepositoryInterface.php
index 64bf47c44e..b360e7d436 100644
--- a/app/Repositories/Tag/TagRepositoryInterface.php
+++ b/app/Repositories/Tag/TagRepositoryInterface.php
@@ -16,6 +16,7 @@ namespace FireflyIII\Repositories\Tag;
use Carbon\Carbon;
use FireflyIII\Models\Tag;
use FireflyIII\Models\TransactionJournal;
+use FireflyIII\User;
use Illuminate\Support\Collection;
@@ -89,6 +90,11 @@ interface TagRepositoryInterface
*/
public function lastUseDate(Tag $tag): Carbon;
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user);
+
/**
* @param Tag $tag
* @param Carbon $start
diff --git a/app/Repositories/User/UserRepositoryInterface.php b/app/Repositories/User/UserRepositoryInterface.php
index 93e34a7a14..9e2bb096b3 100644
--- a/app/Repositories/User/UserRepositoryInterface.php
+++ b/app/Repositories/User/UserRepositoryInterface.php
@@ -24,6 +24,7 @@ use Illuminate\Support\Collection;
*/
interface UserRepositoryInterface
{
+
/**
* Returns a collection of all users.
*
diff --git a/app/Rules/Actions/SetBudget.php b/app/Rules/Actions/SetBudget.php
index 90d7aa6d18..e9f8c1fae9 100644
--- a/app/Rules/Actions/SetBudget.php
+++ b/app/Rules/Actions/SetBudget.php
@@ -50,7 +50,8 @@ class SetBudget implements ActionInterface
public function act(TransactionJournal $journal): bool
{
/** @var BudgetRepositoryInterface $repository */
- $repository = app(BudgetRepositoryInterface::class, [$journal->user]);
+ $repository = app(BudgetRepositoryInterface::class);
+ $repository->setUser($journal->user);
$search = $this->action->action_value;
$budgets = $repository->getActiveBudgets();
$budget = $budgets->filter(
diff --git a/app/Rules/Actions/SetDestinationAccount.php b/app/Rules/Actions/SetDestinationAccount.php
index 829c4928c4..25677e546b 100644
--- a/app/Rules/Actions/SetDestinationAccount.php
+++ b/app/Rules/Actions/SetDestinationAccount.php
@@ -60,7 +60,8 @@ class SetDestinationAccount implements ActionInterface
public function act(TransactionJournal $journal): bool
{
$this->journal = $journal;
- $this->repository = app(AccountRepositoryInterface::class, [$journal->user]);
+ $this->repository = app(AccountRepositoryInterface::class);
+ $this->repository->setUser($journal->user);
$count = $journal->transactions()->count();
if ($count > 2) {
Log::error(sprintf('Cannot change destination account of journal #%d because it is a split journal.', $journal->id));
diff --git a/app/Rules/Actions/SetSourceAccount.php b/app/Rules/Actions/SetSourceAccount.php
index 5e625fe886..fc8067856c 100644
--- a/app/Rules/Actions/SetSourceAccount.php
+++ b/app/Rules/Actions/SetSourceAccount.php
@@ -60,7 +60,8 @@ class SetSourceAccount implements ActionInterface
public function act(TransactionJournal $journal): bool
{
$this->journal = $journal;
- $this->repository = app(AccountRepositoryInterface::class, [$journal->user]);
+ $this->repository = app(AccountRepositoryInterface::class);
+ $this->repository->setUser($journal->user);
$count = $journal->transactions()->count();
if ($count > 2) {
Log::error(sprintf('Cannot change source account of journal #%d because it is a split journal.', $journal->id));
diff --git a/app/Rules/TransactionMatcher.php b/app/Rules/TransactionMatcher.php
index acac7c8521..5241e4f84c 100644
--- a/app/Rules/TransactionMatcher.php
+++ b/app/Rules/TransactionMatcher.php
@@ -78,7 +78,8 @@ class TransactionMatcher
do {
// Fetch a batch of transactions from the database
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [auth()->user()]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser(auth()->user());
$collector->setAllAssetAccounts()->setLimit($pageSize)->setPage($page)->setTypes($this->transactionTypes);
$set = $collector->getPaginatedJournals();
Log::debug(sprintf('Found %d journals to check. ', $set->count()));
diff --git a/app/Support/Search/Search.php b/app/Support/Search/Search.php
index c71e1e2985..b37af85daa 100644
--- a/app/Support/Search/Search.php
+++ b/app/Support/Search/Search.php
@@ -37,16 +37,6 @@ class Search implements SearchInterface
/** @var User */
private $user;
- /**
- * AttachmentRepository constructor.
- *
- * @param User $user
- */
- public function __construct(User $user)
- {
- $this->user = $user;
- }
-
/**
* The search will assume that the user does not have so many accounts
* that this search should be paginated.
@@ -164,7 +154,8 @@ class Search implements SearchInterface
$result = new Collection();
do {
/** @var JournalCollectorInterface $collector */
- $collector = app(JournalCollectorInterface::class, [$this->user]);
+ $collector = app(JournalCollectorInterface::class);
+ $collector->setUser($this->user);
$collector->setAllAssetAccounts()->setLimit($pageSize)->setPage($page);
$set = $collector->getPaginatedJournals();
Log::debug(sprintf('Found %d journals to check. ', $set->count()));
@@ -222,6 +213,14 @@ class Search implements SearchInterface
$this->limit = $limit;
}
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user)
+ {
+ $this->user = $user;
+ }
+
/**
* @param string $haystack
* @param array $needle
@@ -241,4 +240,4 @@ class Search implements SearchInterface
return false;
}
-}
+}
diff --git a/app/Support/Search/SearchInterface.php b/app/Support/Search/SearchInterface.php
index bd16c78853..ed9c3c6c88 100644
--- a/app/Support/Search/SearchInterface.php
+++ b/app/Support/Search/SearchInterface.php
@@ -13,6 +13,7 @@ declare(strict_types = 1);
namespace FireflyIII\Support\Search;
+use FireflyIII\User;
use Illuminate\Support\Collection;
/**
@@ -29,6 +30,11 @@ interface SearchInterface
*/
public function searchAccounts(array $words): Collection;
+ /**
+ * @param User $user
+ */
+ public function setUser(User $user);
+
/**
* @param array $words
*
diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php
index 61590816b4..f38a164993 100644
--- a/app/Validation/FireflyValidator.php
+++ b/app/Validation/FireflyValidator.php
@@ -27,9 +27,9 @@ use FireflyIII\Rules\Triggers\TriggerInterface;
use FireflyIII\User;
use Google2FA;
use Illuminate\Contracts\Encryption\DecryptException;
+use Illuminate\Contracts\Translation\Translator;
use Illuminate\Validation\Validator;
use Session;
-use Symfony\Component\Translation\TranslatorInterface;
/**
* Class FireflyValidator
@@ -40,14 +40,14 @@ class FireflyValidator extends Validator
{
/**
- * @param TranslatorInterface $translator
- * @param array $data
- * @param array $rules
- * @param array $messages
- * @param array $customAttributes
+ * @param Translator $translator
+ * @param array $data
+ * @param array $rules
+ * @param array $messages
+ * @param array $customAttributes
*
*/
- public function __construct(TranslatorInterface $translator, array $data, array $rules, array $messages = [], array $customAttributes = [])
+ public function __construct(Translator $translator, array $data, array $rules, array $messages = [], array $customAttributes = [])
{
parent::__construct($translator, $data, $rules, $messages, $customAttributes);
}
@@ -158,6 +158,7 @@ class FireflyValidator extends Validator
public function validateMore($attribute, $value, $parameters): bool
{
$compare = $parameters[0] ?? '0';
+
return bccomp($value, $compare) > 0;
}
diff --git a/composer.json b/composer.json
index 76c2816122..8e493a3031 100755
--- a/composer.json
+++ b/composer.json
@@ -14,7 +14,7 @@
"financials",
"financial",
"budgets",
- "administration",
+ "administration",
"tool",
"tooling",
"help",
@@ -48,15 +48,15 @@
"require": {
"php": ">=7.0.0",
"ext-intl": "*",
- "ext-bcmath": "*",
- "laravel/framework": "5.3.29",
- "davejamesmiller/laravel-breadcrumbs": "^3.0",
+ "laravel/framework": "5.4.*",
+ "davejamesmiller/laravel-breadcrumbs": "3.1",
"watson/validating": "3.*",
"doctrine/dbal": "^2.5",
"league/commonmark": "0.15.*",
+ "twig/twig": "1.30.0",
"rcrowe/twigbridge": "0.9.*",
"league/csv": "8.*",
- "laravelcollective/html": "^5.3",
+ "laravelcollective/html": "^5.4",
"rmccue/requests": "1.*",
"pragmarx/google2fa": "1.*",
"bacon/bacon-qr-code": "1.*"
@@ -79,9 +79,9 @@
}
},
"autoload-dev": {
- "classmap": [
- "tests/TestCase.php"
- ]
+ "psr-4": {
+ "Tests\\": "tests/"
+ }
},
"scripts": {
"post-root-package-install": [
@@ -105,5 +105,11 @@
},
"config": {
"preferred-install": "dist"
- }
+ },
+ "repositories": [
+ {
+ "type": "vcs",
+ "url": "https://github.com/firefly-iii/laravel-breadcrumbs.git"
+ }
+ ]
}
diff --git a/composer.lock b/composer.lock
index 0792641fa5..1c8211b043 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "098af9634cba1c6d47c25ef1d4803367",
+ "content-hash": "bccf2c2fdac584664dd6c952f1d91ba8",
"packages": [
{
"name": "bacon/bacon-qr-code",
@@ -102,72 +102,18 @@
],
"time": "2016-05-05T11:49:03+00:00"
},
- {
- "name": "classpreloader/classpreloader",
- "version": "3.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/ClassPreloader/ClassPreloader.git",
- "reference": "bc7206aa892b5a33f4680421b69b191efd32b096"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/ClassPreloader/ClassPreloader/zipball/bc7206aa892b5a33f4680421b69b191efd32b096",
- "reference": "bc7206aa892b5a33f4680421b69b191efd32b096",
- "shasum": ""
- },
- "require": {
- "nikic/php-parser": "^1.0|^2.0|^3.0",
- "php": ">=5.5.9"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.8|^5.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.1-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "ClassPreloader\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com"
- },
- {
- "name": "Graham Campbell",
- "email": "graham@alt-three.com"
- }
- ],
- "description": "Helps class loading performance by generating a single PHP file containing all of the autoloaded files for a specific use case",
- "keywords": [
- "autoload",
- "class",
- "preload"
- ],
- "time": "2016-09-16T12:50:15+00:00"
- },
{
"name": "davejamesmiller/laravel-breadcrumbs",
- "version": "3.0.2",
+ "version": "3.1",
"source": {
"type": "git",
- "url": "https://github.com/davejamesmiller/laravel-breadcrumbs.git",
- "reference": "6ca5a600003ecb52a5b5af14dad82033058604e1"
+ "url": "https://github.com/firefly-iii/laravel-breadcrumbs.git",
+ "reference": "afebafc321432188b10dafc7b4c072501687f3d0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/davejamesmiller/laravel-breadcrumbs/zipball/6ca5a600003ecb52a5b5af14dad82033058604e1",
- "reference": "6ca5a600003ecb52a5b5af14dad82033058604e1",
+ "url": "https://api.github.com/repos/firefly-iii/laravel-breadcrumbs/zipball/afebafc321432188b10dafc7b4c072501687f3d0",
+ "reference": "afebafc321432188b10dafc7b4c072501687f3d0",
"shasum": ""
},
"require": {
@@ -187,7 +133,6 @@
"DaveJamesMiller\\Breadcrumbs\\": "src/"
}
},
- "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT License"
],
@@ -203,40 +148,10 @@
"keywords": [
"laravel"
],
- "time": "2017-01-30T21:16:53+00:00"
- },
- {
- "name": "dnoegel/php-xdg-base-dir",
- "version": "0.1",
- "source": {
- "type": "git",
- "url": "https://github.com/dnoegel/php-xdg-base-dir.git",
- "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a"
+ "support": {
+ "source": "https://github.com/firefly-iii/laravel-breadcrumbs/tree/3.1"
},
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/265b8593498b997dc2d31e75b89f053b5cc9621a",
- "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.2"
- },
- "require-dev": {
- "phpunit/phpunit": "@stable"
- },
- "type": "project",
- "autoload": {
- "psr-4": {
- "XdgBaseDir\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "implementation of xdg base directory specification for php",
- "time": "2014-10-24T07:27:01+00:00"
+ "time": "2017-01-30T07:52:50+00:00"
},
{
"name": "doctrine/annotations",
@@ -709,77 +624,26 @@
"time": "2014-09-09T13:34:57+00:00"
},
{
- "name": "jakub-onderka/php-console-color",
- "version": "0.1",
+ "name": "erusev/parsedown",
+ "version": "1.6.1",
"source": {
"type": "git",
- "url": "https://github.com/JakubOnderka/PHP-Console-Color.git",
- "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1"
+ "url": "https://github.com/erusev/parsedown.git",
+ "reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/e0b393dacf7703fc36a4efc3df1435485197e6c1",
- "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1",
+ "url": "https://api.github.com/repos/erusev/parsedown/zipball/20ff8bbb57205368b4b42d094642a3e52dac85fb",
+ "reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb",
"shasum": ""
},
"require": {
- "php": ">=5.3.2"
- },
- "require-dev": {
- "jakub-onderka/php-code-style": "1.0",
- "jakub-onderka/php-parallel-lint": "0.*",
- "jakub-onderka/php-var-dump-check": "0.*",
- "phpunit/phpunit": "3.7.*",
- "squizlabs/php_codesniffer": "1.*"
- },
- "type": "library",
- "autoload": {
- "psr-0": {
- "JakubOnderka\\PhpConsoleColor": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-2-Clause"
- ],
- "authors": [
- {
- "name": "Jakub Onderka",
- "email": "jakub.onderka@gmail.com",
- "homepage": "http://www.acci.cz"
- }
- ],
- "time": "2014-04-08T15:00:19+00:00"
- },
- {
- "name": "jakub-onderka/php-console-highlighter",
- "version": "v0.3.2",
- "source": {
- "type": "git",
- "url": "https://github.com/JakubOnderka/PHP-Console-Highlighter.git",
- "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/7daa75df45242c8d5b75a22c00a201e7954e4fb5",
- "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5",
- "shasum": ""
- },
- "require": {
- "jakub-onderka/php-console-color": "~0.1",
"php": ">=5.3.0"
},
- "require-dev": {
- "jakub-onderka/php-code-style": "~1.0",
- "jakub-onderka/php-parallel-lint": "~0.5",
- "jakub-onderka/php-var-dump-check": "~0.1",
- "phpunit/phpunit": "~4.0",
- "squizlabs/php_codesniffer": "~1.5"
- },
"type": "library",
"autoload": {
"psr-0": {
- "JakubOnderka\\PhpConsoleHighlighter": "src/"
+ "Parsedown": ""
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -788,109 +652,55 @@
],
"authors": [
{
- "name": "Jakub Onderka",
- "email": "acci@acci.cz",
- "homepage": "http://www.acci.cz/"
+ "name": "Emanuil Rusev",
+ "email": "hello@erusev.com",
+ "homepage": "http://erusev.com"
}
],
- "time": "2015-04-20T18:58:01+00:00"
- },
- {
- "name": "jeremeamia/SuperClosure",
- "version": "2.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/jeremeamia/super_closure.git",
- "reference": "443c3df3207f176a1b41576ee2a66968a507b3db"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/jeremeamia/super_closure/zipball/443c3df3207f176a1b41576ee2a66968a507b3db",
- "reference": "443c3df3207f176a1b41576ee2a66968a507b3db",
- "shasum": ""
- },
- "require": {
- "nikic/php-parser": "^1.2|^2.0|^3.0",
- "php": ">=5.4",
- "symfony/polyfill-php56": "^1.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.0|^5.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.3-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "SuperClosure\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Jeremy Lindblom",
- "email": "jeremeamia@gmail.com",
- "homepage": "https://github.com/jeremeamia",
- "role": "Developer"
- }
- ],
- "description": "Serialize Closure objects, including their context and binding",
- "homepage": "https://github.com/jeremeamia/super_closure",
+ "description": "Parser for Markdown.",
+ "homepage": "http://parsedown.org",
"keywords": [
- "closure",
- "function",
- "lambda",
- "parser",
- "serializable",
- "serialize",
- "tokenizer"
+ "markdown",
+ "parser"
],
- "time": "2016-12-07T09:37:55+00:00"
+ "time": "2016-11-02T15:56:58+00:00"
},
{
"name": "laravel/framework",
- "version": "v5.3.29",
+ "version": "v5.4.9",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "6fd76dec90466dc3f703d8df72e38130f2ee6a32"
+ "reference": "600330ae1d218919b3b307e0578461a2df248663"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/6fd76dec90466dc3f703d8df72e38130f2ee6a32",
- "reference": "6fd76dec90466dc3f703d8df72e38130f2ee6a32",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/600330ae1d218919b3b307e0578461a2df248663",
+ "reference": "600330ae1d218919b3b307e0578461a2df248663",
"shasum": ""
},
"require": {
- "classpreloader/classpreloader": "~3.0",
"doctrine/inflector": "~1.0",
+ "erusev/parsedown": "~1.6",
"ext-mbstring": "*",
"ext-openssl": "*",
- "jeremeamia/superclosure": "~2.2",
"league/flysystem": "~1.0",
"monolog/monolog": "~1.11",
"mtdowling/cron-expression": "~1.0",
"nesbot/carbon": "~1.20",
"paragonie/random_compat": "~1.4|~2.0",
"php": ">=5.6.4",
- "psy/psysh": "0.7.*|0.8.*",
"ramsey/uuid": "~3.0",
"swiftmailer/swiftmailer": "~5.4",
- "symfony/console": "3.1.*",
- "symfony/debug": "3.1.*",
- "symfony/finder": "3.1.*",
- "symfony/http-foundation": "3.1.*",
- "symfony/http-kernel": "3.1.*",
- "symfony/process": "3.1.*",
- "symfony/routing": "3.1.*",
- "symfony/translation": "3.1.*",
- "symfony/var-dumper": "3.1.*",
+ "symfony/console": "~3.2",
+ "symfony/debug": "~3.2",
+ "symfony/finder": "~3.2",
+ "symfony/http-foundation": "~3.2",
+ "symfony/http-kernel": "~3.2",
+ "symfony/process": "~3.2",
+ "symfony/routing": "~3.2",
+ "symfony/var-dumper": "~3.2",
+ "tijsverkoyen/css-to-inline-styles": "~2.2",
"vlucas/phpdotenv": "~2.2"
},
"replace": {
@@ -927,31 +737,34 @@
},
"require-dev": {
"aws/aws-sdk-php": "~3.0",
+ "doctrine/dbal": "~2.5",
"mockery/mockery": "~0.9.4",
"pda/pheanstalk": "~3.0",
- "phpunit/phpunit": "~5.4",
+ "phpunit/phpunit": "~5.7",
"predis/predis": "~1.0",
- "symfony/css-selector": "3.1.*",
- "symfony/dom-crawler": "3.1.*"
+ "symfony/css-selector": "~3.2",
+ "symfony/dom-crawler": "~3.2"
},
"suggest": {
"aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (~3.0).",
- "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.4).",
+ "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.5).",
"fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).",
- "guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~5.3|~6.0).",
+ "guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~6.0).",
+ "laravel/tinker": "Required to use the tinker console command (~1.0).",
"league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).",
"league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).",
+ "nexmo/client": "Required to use the Nexmo transport (~1.0).",
"pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0).",
"predis/predis": "Required to use the redis cache and queue drivers (~1.0).",
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0).",
- "symfony/css-selector": "Required to use some of the crawler integration testing tools (3.1.*).",
- "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (3.1.*).",
- "symfony/psr-http-message-bridge": "Required to use psr7 bridging features (0.2.*)."
+ "symfony/css-selector": "Required to use some of the crawler integration testing tools (~3.2).",
+ "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (~3.2).",
+ "symfony/psr-http-message-bridge": "Required to psr7 bridging features (0.2.*)."
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "5.3-dev"
+ "dev-master": "5.4-dev"
}
},
"autoload": {
@@ -979,32 +792,32 @@
"framework",
"laravel"
],
- "time": "2017-01-06T14:33:56+00:00"
+ "time": "2017-02-03T19:47:35+00:00"
},
{
"name": "laravelcollective/html",
- "version": "v5.3.1",
+ "version": "v5.4.1",
"source": {
"type": "git",
"url": "https://github.com/LaravelCollective/html.git",
- "reference": "2f7f2e127c6fed47f269ea29ab5efeb8f65e9d35"
+ "reference": "7570f25d58a00fd6909c0563808590f9cdb14d47"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/LaravelCollective/html/zipball/2f7f2e127c6fed47f269ea29ab5efeb8f65e9d35",
- "reference": "2f7f2e127c6fed47f269ea29ab5efeb8f65e9d35",
+ "url": "https://api.github.com/repos/LaravelCollective/html/zipball/7570f25d58a00fd6909c0563808590f9cdb14d47",
+ "reference": "7570f25d58a00fd6909c0563808590f9cdb14d47",
"shasum": ""
},
"require": {
- "illuminate/http": "5.3.*",
- "illuminate/routing": "5.3.*",
- "illuminate/session": "5.3.*",
- "illuminate/support": "5.3.*",
- "illuminate/view": "5.3.*",
+ "illuminate/http": "5.4.*",
+ "illuminate/routing": "5.4.*",
+ "illuminate/session": "5.4.*",
+ "illuminate/support": "5.4.*",
+ "illuminate/view": "5.4.*",
"php": ">=5.6.4"
},
"require-dev": {
- "illuminate/database": "5.3.*",
+ "illuminate/database": "5.4.*",
"mockery/mockery": "~0.9.4",
"phpunit/phpunit": "~5.4"
},
@@ -1033,7 +846,7 @@
],
"description": "HTML and Form Builders for the Laravel Framework",
"homepage": "http://laravelcollective.com",
- "time": "2016-12-13T14:23:36+00:00"
+ "time": "2017-01-26T19:27:05+00:00"
},
{
"name": "league/commonmark",
@@ -1419,57 +1232,6 @@
],
"time": "2017-01-16T07:55:07+00:00"
},
- {
- "name": "nikic/php-parser",
- "version": "v3.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "5b8182cc0abb4b0ff290ba9df6c0e1323286013a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/5b8182cc0abb4b0ff290ba9df6c0e1323286013a",
- "reference": "5b8182cc0abb4b0ff290ba9df6c0e1323286013a",
- "shasum": ""
- },
- "require": {
- "ext-tokenizer": "*",
- "php": ">=5.5"
- },
- "require-dev": {
- "phpunit/phpunit": "~4.0|~5.0"
- },
- "bin": [
- "bin/php-parse"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.0-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "PhpParser\\": "lib/PhpParser"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Nikita Popov"
- }
- ],
- "description": "A PHP parser written in PHP",
- "keywords": [
- "parser",
- "php"
- ],
- "time": "2017-02-03T21:57:31+00:00"
- },
{
"name": "paragonie/random_compat",
"version": "v2.0.4",
@@ -1626,79 +1388,6 @@
],
"time": "2016-10-10T12:19:37+00:00"
},
- {
- "name": "psy/psysh",
- "version": "v0.8.1",
- "source": {
- "type": "git",
- "url": "https://github.com/bobthecow/psysh.git",
- "reference": "701e8a1cc426ee170f1296f5d9f6b8a26ad25c4a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/bobthecow/psysh/zipball/701e8a1cc426ee170f1296f5d9f6b8a26ad25c4a",
- "reference": "701e8a1cc426ee170f1296f5d9f6b8a26ad25c4a",
- "shasum": ""
- },
- "require": {
- "dnoegel/php-xdg-base-dir": "0.1",
- "jakub-onderka/php-console-highlighter": "0.3.*",
- "nikic/php-parser": "~1.3|~2.0|~3.0",
- "php": ">=5.3.9",
- "symfony/console": "~2.3.10|^2.4.2|~3.0",
- "symfony/var-dumper": "~2.7|~3.0"
- },
- "require-dev": {
- "friendsofphp/php-cs-fixer": "~1.11",
- "hoa/console": "~3.16|~1.14",
- "phpunit/phpunit": "~4.4|~5.0",
- "symfony/finder": "~2.1|~3.0"
- },
- "suggest": {
- "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)",
- "ext-pdo-sqlite": "The doc command requires SQLite to work.",
- "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.",
- "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.",
- "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit."
- },
- "bin": [
- "bin/psysh"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-develop": "0.9.x-dev"
- }
- },
- "autoload": {
- "files": [
- "src/Psy/functions.php"
- ],
- "psr-4": {
- "Psy\\": "src/Psy/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Justin Hileman",
- "email": "justin@justinhileman.info",
- "homepage": "http://justinhileman.com"
- }
- ],
- "description": "An interactive shell for modern PHP.",
- "homepage": "http://psysh.org",
- "keywords": [
- "REPL",
- "console",
- "interactive",
- "shell"
- ],
- "time": "2017-01-15T17:54:13+00:00"
- },
{
"name": "ramsey/uuid",
"version": "3.5.2",
@@ -1950,16 +1639,16 @@
},
{
"name": "symfony/console",
- "version": "v3.1.10",
+ "version": "v3.2.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "047f16485d68c083bd5d9b73ff16f9cb9c1a9f52"
+ "reference": "4f9e449e76996adf310498a8ca955c6deebe29dd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/047f16485d68c083bd5d9b73ff16f9cb9c1a9f52",
- "reference": "047f16485d68c083bd5d9b73ff16f9cb9c1a9f52",
+ "url": "https://api.github.com/repos/symfony/console/zipball/4f9e449e76996adf310498a8ca955c6deebe29dd",
+ "reference": "4f9e449e76996adf310498a8ca955c6deebe29dd",
"shasum": ""
},
"require": {
@@ -1970,17 +1659,19 @@
"require-dev": {
"psr/log": "~1.0",
"symfony/event-dispatcher": "~2.8|~3.0",
+ "symfony/filesystem": "~2.8|~3.0",
"symfony/process": "~2.8|~3.0"
},
"suggest": {
"psr/log": "For using the console logger",
"symfony/event-dispatcher": "",
+ "symfony/filesystem": "",
"symfony/process": ""
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-master": "3.2-dev"
}
},
"autoload": {
@@ -2007,20 +1698,73 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
- "time": "2017-01-08T20:43:43+00:00"
+ "time": "2017-01-08T20:47:33+00:00"
},
{
- "name": "symfony/debug",
+ "name": "symfony/css-selector",
"version": "v3.1.10",
"source": {
"type": "git",
- "url": "https://github.com/symfony/debug.git",
- "reference": "c6661361626b3cf5cf2089df98b3b5006a197e85"
+ "url": "https://github.com/symfony/css-selector.git",
+ "reference": "722a87478a72d95dc2a3bcf41dc9c2d13fd4cb2d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/c6661361626b3cf5cf2089df98b3b5006a197e85",
- "reference": "c6661361626b3cf5cf2089df98b3b5006a197e85",
+ "url": "https://api.github.com/repos/symfony/css-selector/zipball/722a87478a72d95dc2a3bcf41dc9c2d13fd4cb2d",
+ "reference": "722a87478a72d95dc2a3bcf41dc9c2d13fd4cb2d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5.9"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\CssSelector\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jean-François Simon",
+ "email": "jeanfrancois.simon@sensiolabs.com"
+ },
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony CssSelector Component",
+ "homepage": "https://symfony.com",
+ "time": "2017-01-02T20:31:54+00:00"
+ },
+ {
+ "name": "symfony/debug",
+ "version": "v3.2.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/debug.git",
+ "reference": "810ba5c1c5352a4ddb15d4719e8936751dff0b05"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/810ba5c1c5352a4ddb15d4719e8936751dff0b05",
+ "reference": "810ba5c1c5352a4ddb15d4719e8936751dff0b05",
"shasum": ""
},
"require": {
@@ -2037,7 +1781,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-master": "3.2-dev"
}
},
"autoload": {
@@ -2064,7 +1808,7 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
- "time": "2017-01-28T00:04:57+00:00"
+ "time": "2017-01-02T20:32:22+00:00"
},
{
"name": "symfony/event-dispatcher",
@@ -2128,16 +1872,16 @@
},
{
"name": "symfony/finder",
- "version": "v3.1.10",
+ "version": "v3.2.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "59687a255d1562f2c17b012418273862083d85f7"
+ "reference": "8c71141cae8e2957946b403cc71a67213c0380d6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/59687a255d1562f2c17b012418273862083d85f7",
- "reference": "59687a255d1562f2c17b012418273862083d85f7",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/8c71141cae8e2957946b403cc71a67213c0380d6",
+ "reference": "8c71141cae8e2957946b403cc71a67213c0380d6",
"shasum": ""
},
"require": {
@@ -2146,7 +1890,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-master": "3.2-dev"
}
},
"autoload": {
@@ -2173,20 +1917,20 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
- "time": "2017-01-02T20:31:54+00:00"
+ "time": "2017-01-02T20:32:22+00:00"
},
{
"name": "symfony/http-foundation",
- "version": "v3.1.10",
+ "version": "v3.2.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
- "reference": "cef0ad49a2e90455cfc649522025b5a2929648c0"
+ "reference": "33eb76bf1d833c705433e5361a646c164696394b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-foundation/zipball/cef0ad49a2e90455cfc649522025b5a2929648c0",
- "reference": "cef0ad49a2e90455cfc649522025b5a2929648c0",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/33eb76bf1d833c705433e5361a646c164696394b",
+ "reference": "33eb76bf1d833c705433e5361a646c164696394b",
"shasum": ""
},
"require": {
@@ -2199,7 +1943,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-master": "3.2-dev"
}
},
"autoload": {
@@ -2226,20 +1970,20 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
- "time": "2017-01-08T20:43:43+00:00"
+ "time": "2017-01-08T20:47:33+00:00"
},
{
"name": "symfony/http-kernel",
- "version": "v3.1.10",
+ "version": "v3.2.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
- "reference": "c830387dec1b48c100473d10a6a356c3c3ae2a13"
+ "reference": "8a898e340a89022246645b1288d295f49c9381e4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-kernel/zipball/c830387dec1b48c100473d10a6a356c3c3ae2a13",
- "reference": "c830387dec1b48c100473d10a6a356c3c3ae2a13",
+ "url": "https://api.github.com/repos/symfony/http-kernel/zipball/8a898e340a89022246645b1288d295f49c9381e4",
+ "reference": "8a898e340a89022246645b1288d295f49c9381e4",
"shasum": ""
},
"require": {
@@ -2267,7 +2011,7 @@
"symfony/stopwatch": "~2.8|~3.0",
"symfony/templating": "~2.8|~3.0",
"symfony/translation": "~2.8|~3.0",
- "symfony/var-dumper": "~2.8|~3.0"
+ "symfony/var-dumper": "~3.2"
},
"suggest": {
"symfony/browser-kit": "",
@@ -2281,7 +2025,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-master": "3.2-dev"
}
},
"autoload": {
@@ -2308,7 +2052,7 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com",
- "time": "2017-01-28T02:53:17+00:00"
+ "time": "2017-01-12T21:36:33+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -2479,16 +2223,16 @@
},
{
"name": "symfony/process",
- "version": "v3.1.10",
+ "version": "v3.2.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "2605753c5f8c531623d24d002825ebb1d6a22248"
+ "reference": "350e810019fc52dd06ae844b6a6d382f8a0e8893"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/2605753c5f8c531623d24d002825ebb1d6a22248",
- "reference": "2605753c5f8c531623d24d002825ebb1d6a22248",
+ "url": "https://api.github.com/repos/symfony/process/zipball/350e810019fc52dd06ae844b6a6d382f8a0e8893",
+ "reference": "350e810019fc52dd06ae844b6a6d382f8a0e8893",
"shasum": ""
},
"require": {
@@ -2497,7 +2241,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-master": "3.2-dev"
}
},
"autoload": {
@@ -2524,20 +2268,20 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
- "time": "2017-01-21T17:13:55+00:00"
+ "time": "2017-01-02T20:32:22+00:00"
},
{
"name": "symfony/routing",
- "version": "v3.1.10",
+ "version": "v3.2.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
- "reference": "f25581d4eb0a82962c291917f826166f0dcd8a9a"
+ "reference": "fda2c67d47ec801726ca888c95d701d31b27b444"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/routing/zipball/f25581d4eb0a82962c291917f826166f0dcd8a9a",
- "reference": "f25581d4eb0a82962c291917f826166f0dcd8a9a",
+ "url": "https://api.github.com/repos/symfony/routing/zipball/fda2c67d47ec801726ca888c95d701d31b27b444",
+ "reference": "fda2c67d47ec801726ca888c95d701d31b27b444",
"shasum": ""
},
"require": {
@@ -2566,7 +2310,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-master": "3.2-dev"
}
},
"autoload": {
@@ -2599,20 +2343,20 @@
"uri",
"url"
],
- "time": "2017-01-28T00:04:57+00:00"
+ "time": "2017-01-02T20:32:22+00:00"
},
{
"name": "symfony/translation",
- "version": "v3.1.10",
+ "version": "v3.2.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
- "reference": "d5a20fab5f63f44c233c69b3041c3cb1d4945e45"
+ "reference": "6520f3d4cce604d9dd1e86cac7af954984dd9bda"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation/zipball/d5a20fab5f63f44c233c69b3041c3cb1d4945e45",
- "reference": "d5a20fab5f63f44c233c69b3041c3cb1d4945e45",
+ "url": "https://api.github.com/repos/symfony/translation/zipball/6520f3d4cce604d9dd1e86cac7af954984dd9bda",
+ "reference": "6520f3d4cce604d9dd1e86cac7af954984dd9bda",
"shasum": ""
},
"require": {
@@ -2636,7 +2380,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-master": "3.2-dev"
}
},
"autoload": {
@@ -2663,20 +2407,20 @@
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
- "time": "2017-01-21T17:01:39+00:00"
+ "time": "2017-01-02T20:32:22+00:00"
},
{
"name": "symfony/var-dumper",
- "version": "v3.1.10",
+ "version": "v3.2.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
- "reference": "16df11647e5b992d687cb4eeeb9a882d5f5c26b9"
+ "reference": "b54b23f9a19b465e76fdaac0f6732410467c83b2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/var-dumper/zipball/16df11647e5b992d687cb4eeeb9a882d5f5c26b9",
- "reference": "16df11647e5b992d687cb4eeeb9a882d5f5c26b9",
+ "url": "https://api.github.com/repos/symfony/var-dumper/zipball/b54b23f9a19b465e76fdaac0f6732410467c83b2",
+ "reference": "b54b23f9a19b465e76fdaac0f6732410467c83b2",
"shasum": ""
},
"require": {
@@ -2692,7 +2436,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-master": "3.2-dev"
}
},
"autoload": {
@@ -2726,20 +2470,67 @@
"debug",
"dump"
],
- "time": "2017-01-24T13:02:38+00:00"
+ "time": "2017-01-03T08:53:57+00:00"
},
{
- "name": "twig/twig",
- "version": "v1.31.0",
+ "name": "tijsverkoyen/css-to-inline-styles",
+ "version": "2.2.0",
"source": {
"type": "git",
- "url": "https://github.com/twigphp/Twig.git",
- "reference": "ddc9e3e20ee9c0b6908f401ac8353635b750eca7"
+ "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git",
+ "reference": "ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/twigphp/Twig/zipball/ddc9e3e20ee9c0b6908f401ac8353635b750eca7",
- "reference": "ddc9e3e20ee9c0b6908f401ac8353635b750eca7",
+ "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b",
+ "reference": "ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5 || ^7",
+ "symfony/css-selector": "^2.7|~3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.8|5.1.*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "TijsVerkoyen\\CssToInlineStyles\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Tijs Verkoyen",
+ "email": "css_to_inline_styles@verkoyen.eu",
+ "role": "Developer"
+ }
+ ],
+ "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.",
+ "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles",
+ "time": "2016-09-20T12:50:39+00:00"
+ },
+ {
+ "name": "twig/twig",
+ "version": "v1.30.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/twigphp/Twig.git",
+ "reference": "c6ff71094fde15d12398eaba029434b013dc5e59"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/twigphp/Twig/zipball/c6ff71094fde15d12398eaba029434b013dc5e59",
+ "reference": "c6ff71094fde15d12398eaba029434b013dc5e59",
"shasum": ""
},
"require": {
@@ -2747,12 +2538,12 @@
},
"require-dev": {
"symfony/debug": "~2.7",
- "symfony/phpunit-bridge": "~3.2"
+ "symfony/phpunit-bridge": "~3.2@dev"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.31-dev"
+ "dev-master": "1.30-dev"
}
},
"autoload": {
@@ -2787,7 +2578,7 @@
"keywords": [
"templating"
],
- "time": "2017-01-11T19:36:15+00:00"
+ "time": "2016-12-23T11:06:22+00:00"
},
{
"name": "vlucas/phpdotenv",
@@ -4538,59 +4329,6 @@
"homepage": "https://symfony.com",
"time": "2017-01-10T14:14:38+00:00"
},
- {
- "name": "symfony/css-selector",
- "version": "v3.1.10",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/css-selector.git",
- "reference": "722a87478a72d95dc2a3bcf41dc9c2d13fd4cb2d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/css-selector/zipball/722a87478a72d95dc2a3bcf41dc9c2d13fd4cb2d",
- "reference": "722a87478a72d95dc2a3bcf41dc9c2d13fd4cb2d",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5.9"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.1-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\CssSelector\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Jean-François Simon",
- "email": "jeanfrancois.simon@sensiolabs.com"
- },
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony CssSelector Component",
- "homepage": "https://symfony.com",
- "time": "2017-01-02T20:31:54+00:00"
- },
{
"name": "symfony/dom-crawler",
"version": "v3.1.10",
@@ -4760,8 +4498,7 @@
"prefer-lowest": false,
"platform": {
"php": ">=7.0.0",
- "ext-intl": "*",
- "ext-bcmath": "*"
+ "ext-intl": "*"
},
"platform-dev": []
}
diff --git a/config/app.php b/config/app.php
index 4933ad1c8c..1bbf9d2452 100755
--- a/config/app.php
+++ b/config/app.php
@@ -26,8 +26,8 @@ return [
'providers' => [
/*
- * Laravel Framework Service Providers...
- */
+ * Laravel Framework Service Providers...
+ */
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
@@ -50,12 +50,11 @@ return [
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
- Collective\Html\HtmlServiceProvider::class,
-
/*
* Application Service Providers...
*/
+ FireflyIII\Providers\LogServiceProvider::class,
FireflyIII\Providers\AppServiceProvider::class,
FireflyIII\Providers\AuthServiceProvider::class,
// FireflyIII\Providers\BroadcastServiceProvider::class,
@@ -74,7 +73,6 @@ return [
/*
* More service providers.
*/
- FireflyIII\Providers\CrudServiceProvider::class,
FireflyIII\Providers\AccountServiceProvider::class,
FireflyIII\Providers\AttachmentServiceProvider::class,
FireflyIII\Providers\BillServiceProvider::class,
@@ -92,11 +90,12 @@ return [
],
'aliases' => [
-
'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
+ 'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
+ 'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
diff --git a/phpunit.xml b/phpunit.xml
index 9f026f875f..c096c7a945 100755
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -17,7 +17,6 @@
./tests/unit
-
./app
diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php
new file mode 100644
index 0000000000..8d8a77e99d
--- /dev/null
+++ b/tests/CreatesApplication.php
@@ -0,0 +1,22 @@
+make(Kernel::class)->bootstrap();
+
+ return $app;
+ }
+}
\ No newline at end of file
diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php
deleted file mode 100644
index 74a0a460d6..0000000000
--- a/tests/ExampleTest.php
+++ /dev/null
@@ -1,27 +0,0 @@
-visit('/')
- ->see('Firefly');
- }
-}
diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php
new file mode 100644
index 0000000000..c23bfc63d5
--- /dev/null
+++ b/tests/Feature/ExampleTest.php
@@ -0,0 +1,23 @@
+get('/');
+
+ $response->assertStatus(200);
+ }
+}
\ No newline at end of file
diff --git a/tests/TestCase.php b/tests/TestCase.php
index c2a57c8e43..03cde96b56 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -1,153 +1,15 @@
id)->where('name', 'viewRange')->delete();
- Preference::create(
- [
- 'user_id' => $user->id,
- 'name' => 'viewRange',
- 'data' => $range,
- ]
- );
- // set period to match?
-
- }
- if ($range === 'custom') {
- $this->session(
- [
- 'start' => Carbon::now()->subDays(20),
- 'end' => Carbon::now(),
- ]
- );
- }
- }
-
- /**
- * Creates the application.
- *
- * @return \Illuminate\Foundation\Application
- */
- public function createApplication()
- {
- $app = require __DIR__ . '/../bootstrap/app.php';
-
- $app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
-
- return $app;
- }
-
- /**
- * @return array
- */
- public function dateRangeProvider()
- {
- return [
- 'one day' => ['1D'],
- 'one week' => ['1W'],
- 'one month' => ['1M'],
- 'three months' => ['3M'],
- 'six months' => ['6M'],
- 'one year' => ['1Y'],
- 'custom range' => ['custom'],
- ];
- }
-
- /**
- * @return User
- */
- public function emptyUser()
- {
- $user = User::find(2);
-
- return $user;
- }
-
- /**
- * @return array
- */
- public function naughtyStringProvider()
- {
- /*
- * If on Travis, return very small set.
- */
- if (getenv('TRAVIS') == 'true') {
- return [['Default value']];
-
- }
- $path = realpath(__DIR__ . '/../resources/tests/blns.base64.json');
- $content = file_get_contents($path);
- $array = json_decode($content);
- $return = [];
- foreach ($array as $entry) {
- $return[] = [base64_decode($entry)];
- }
-
- return $return;
- }
-
- /**
- * Sets up the fixture, for example, opens a network connection.
- * This method is called before a test is executed.
- */
- public function setUp()
- {
- parent::setUp();
-
- }
-
- /**
- * @return User
- */
- public function user()
- {
- $user = User::find(1);
-
- return $user;
- }
-
- /**
- * @param string $class
- *
- * @return \Mockery\MockInterface
- */
- protected function mock($class)
- {
- Log::debug(sprintf('Will now mock %s', $class));
- $object = Mockery::mock($class);
- $this->app->instance($class, $object);
-
- return $object;
- }
-}
+ use CreatesApplication;
+}
\ No newline at end of file
diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php
new file mode 100644
index 0000000000..239346394a
--- /dev/null
+++ b/tests/Unit/ExampleTest.php
@@ -0,0 +1,20 @@
+assertTrue(true);
+ }
+}
\ No newline at end of file
diff --git a/tests/acceptance/Controllers/AccountControllerTest.php b/tests/acceptance/Controllers/AccountControllerTest.php
deleted file mode 100644
index e42a5a8d1a..0000000000
--- a/tests/acceptance/Controllers/AccountControllerTest.php
+++ /dev/null
@@ -1,224 +0,0 @@
-be($this->user());
- $this->call('GET', route('accounts.create', ['asset']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('GET', route('accounts.delete', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::destroy
- */
- public function testDestroy()
- {
- $this->session(['accounts.delete.url' => 'http://localhost/accounts/show/1']);
-
- $repository = $this->mock(AccountRepositoryInterface::class);
- $repository->shouldReceive('find')->withArgs([0])->once()->andReturn(new Account);
- $repository->shouldReceive('destroy')->andReturn(true);
-
- $this->be($this->user());
- $this->call('post', route('accounts.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('GET', route('accounts.edit', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::index
- * @covers FireflyIII\Http\Controllers\AccountController::isInArray
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testIndex(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('accounts.index', ['asset']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::show
- * @covers FireflyIII\Http\Controllers\AccountController::periodEntries
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testShow(string $range)
- {
- $date = new Carbon;
- $this->session(['start' => $date, 'end' => clone $date]);
-
- $tasker = $this->mock(AccountTaskerInterface::class);
- $tasker->shouldReceive('amountOutInPeriod')->withAnyArgs()->andReturn('-1');
- $tasker->shouldReceive('amountInInPeriod')->withAnyArgs()->andReturn('1');
-
- // mock repository:
- $repository = $this->mock(AccountRepositoryInterface::class);
- $repository->shouldReceive('oldestJournalDate')->andReturn(clone $date);
- $repository->shouldReceive('getAccountsByType')->andReturn(new Collection);
-
-
- $collector = $this->mock(JournalCollectorInterface::class);
- $collector->shouldReceive('setAccounts')->andReturnSelf();
- $collector->shouldReceive('setRange')->andReturnSelf();
- $collector->shouldReceive('setLimit')->andReturnSelf();
- $collector->shouldReceive('setPage')->andReturnSelf();
- $collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('accounts.show', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::showAll
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testShowAll(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('accounts.show.all', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::showByDate
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testShowByDate(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('accounts.show.date', [1, '2016-01-01']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::store
- */
- public function testStore()
- {
- $this->session(['accounts.create.url' => 'http://localhost']);
- $this->be($this->user());
- $data = [
- 'name' => 'new account ' . rand(1000, 9999),
- 'what' => 'asset',
- ];
-
- $this->call('post', route('accounts.store', ['asset']), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- // list should have this new account.
- $this->call('GET', route('accounts.index', ['asset']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- $this->see($data['name']);
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::update
- */
- public function testUpdate()
- {
- $this->session(['accounts.edit.url' => 'http://localhost']);
- $this->be($this->user());
- $data = [
- 'name' => 'updated account ' . rand(1000, 9999),
- 'active' => 1,
- 'what' => 'asset',
- ];
-
- $this->call('post', route('accounts.update', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- // list should have this new account.
- $this->call('GET', route('accounts.index', ['asset']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- $this->see($data['name']);
- }
-}
diff --git a/tests/acceptance/Controllers/Admin/ConfigurationControllerTest.php b/tests/acceptance/Controllers/Admin/ConfigurationControllerTest.php
deleted file mode 100644
index b212b656fd..0000000000
--- a/tests/acceptance/Controllers/Admin/ConfigurationControllerTest.php
+++ /dev/null
@@ -1,75 +0,0 @@
-be($this->user());
-
- $falseConfig = new Configuration;
- $falseConfig->data = false;
-
- $trueConfig = new Configuration;
- $trueConfig->data = true;
-
- FireflyConfig::shouldReceive('get')->withArgs(['single_user_mode', true])->once()->andReturn($trueConfig);
- FireflyConfig::shouldReceive('get')->withArgs(['is_demo_site', false])->times(2)->andReturn($falseConfig);
-
- $this->call('GET', route('admin.configuration.index'));
- $this->assertResponseStatus(200);
-
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Admin\ConfigurationController::postIndex
- */
- public function testPostIndex()
- {
- $falseConfig = new Configuration;
- $falseConfig->data = false;
-
- FireflyConfig::shouldReceive('get')->withArgs(['is_demo_site', false])->once()->andReturn($falseConfig);
- FireflyConfig::shouldReceive('set')->withArgs(['single_user_mode', false])->once();
- FireflyConfig::shouldReceive('set')->withArgs(['is_demo_site', false])->once();
-
- $this->be($this->user());
- $this->call('POST', route('admin.configuration.index.post'));
- $this->assertSessionHas('success');
- $this->assertResponseStatus(302);
- }
-}
diff --git a/tests/acceptance/Controllers/Admin/HomeControllerTest.php b/tests/acceptance/Controllers/Admin/HomeControllerTest.php
deleted file mode 100644
index 8a2ccefb60..0000000000
--- a/tests/acceptance/Controllers/Admin/HomeControllerTest.php
+++ /dev/null
@@ -1,44 +0,0 @@
-be($this->user());
- $this->call('GET', route('admin.index'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
-}
diff --git a/tests/acceptance/Controllers/Admin/UserControllerTest.php b/tests/acceptance/Controllers/Admin/UserControllerTest.php
deleted file mode 100644
index b5e246bc4d..0000000000
--- a/tests/acceptance/Controllers/Admin/UserControllerTest.php
+++ /dev/null
@@ -1,68 +0,0 @@
-be($this->user());
- $this->call('GET', route('admin.users.edit', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Admin\UserController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('GET', route('admin.users'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Admin\UserController::show
- */
- public function testShow()
- {
- $this->be($this->user());
- $this->call('GET', route('admin.users.edit', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
-}
diff --git a/tests/acceptance/Controllers/AttachmentControllerTest.php b/tests/acceptance/Controllers/AttachmentControllerTest.php
deleted file mode 100644
index a2fdbc3d07..0000000000
--- a/tests/acceptance/Controllers/AttachmentControllerTest.php
+++ /dev/null
@@ -1,121 +0,0 @@
-be($this->user());
- $this->call('GET', route('attachments.delete', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\AttachmentController::destroy
- */
- public function testDestroy()
- {
- $this->session(['attachments.delete.url' => 'http://localhost']);
-
- $repository = $this->mock(AttachmentRepositoryInterface::class);
- $repository->shouldReceive('destroy')->andReturn(true);
- $this->be($this->user());
- $this->call('post', route('attachments.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\AttachmentController::download
- */
- public function testDownload()
- {
- $repository = $this->mock(AttachmentRepositoryInterface::class);
- $repository->shouldReceive('exists')->once()->andReturn(true);
- $repository->shouldReceive('getContent')->once()->andReturn('This is attachment number one.');
-
- $this->be($this->user());
- $this->call('GET', route('attachments.download', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('This is attachment number one.');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\AttachmentController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('GET', route('attachments.edit', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\AttachmentController::preview
- */
- public function testPreview()
- {
- $this->be($this->user());
- $this->call('GET', route('attachments.preview', [1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\AttachmentController::update
- */
- public function testUpdate()
- {
- $this->session(['attachments.edit.url' => 'http://localhost']);
- $data = [
- 'title' => 'Some updated title ' . rand(1000, 9999),
- 'notes' => '',
- 'description' => '',
- ];
-
- $this->be($this->user());
- $this->call('post', route('attachments.update', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- // view should be updated
- $this->be($this->user());
- $this->call('GET', route('attachments.edit', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- $this->see($data['title']);
- }
-
-}
diff --git a/tests/acceptance/Controllers/Auth/LoginControllerTest.php b/tests/acceptance/Controllers/Auth/LoginControllerTest.php
deleted file mode 100644
index 5125dccb98..0000000000
--- a/tests/acceptance/Controllers/Auth/LoginControllerTest.php
+++ /dev/null
@@ -1,64 +0,0 @@
-visit('/login')
- ->type('thegrumpydictator@gmail.com', 'email')
- ->type('james', 'password')
- ->press('Sign In')
- ->seePageIs('/')
- ->see('thegrumpydictator@gmail.com');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Auth\LoginController::logout
- */
- public function testLogout()
- {
- $this->visit('/logout')
- ->seePageIs('/login')
- ->see('Sign in to start your session');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Auth\LoginController::showLoginForm
- */
- public function testShowLoginForm()
- {
- $this->visit('/')
- ->seePageIs('/login')
- ->see('Sign in to start your session');
- }
-}
diff --git a/tests/acceptance/Controllers/Auth/TwoFactorControllerTest.php b/tests/acceptance/Controllers/Auth/TwoFactorControllerTest.php
deleted file mode 100644
index 5661e5823c..0000000000
--- a/tests/acceptance/Controllers/Auth/TwoFactorControllerTest.php
+++ /dev/null
@@ -1,70 +0,0 @@
-be($this->user());
-
- $falsePreference = new Preference;
- $falsePreference->data = true;
- $secretPreference = new Preference;
- $secretPreference->data = 'BlablaSeecret';
- Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($falsePreference);
- Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn($secretPreference);
- Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn($secretPreference);
- $this->call('get', route('two-factor.index'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Auth\TwoFactorController::lostTwoFactor
- */
- public function testLostTwoFactor()
- {
- $this->be($this->user());
-
- $truePreference = new Preference;
- $truePreference->data = true;
- $secretPreference = new Preference;
- $secretPreference->data = 'BlablaSeecret';
- Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($truePreference);
- Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn($secretPreference);
- Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn($secretPreference);
- $this->call('get', route('two-factor.lost'));
- $this->assertResponseStatus(200);
- }
-
-}
diff --git a/tests/acceptance/Controllers/BillControllerTest.php b/tests/acceptance/Controllers/BillControllerTest.php
deleted file mode 100644
index 60a8388697..0000000000
--- a/tests/acceptance/Controllers/BillControllerTest.php
+++ /dev/null
@@ -1,179 +0,0 @@
-be($this->user());
- $this->call('GET', route('bills.create'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BillController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('GET', route('bills.delete', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BillController::destroy
- */
- public function testDestroy()
- {
- $repository = $this->mock(BillRepositoryInterface::class);
- $repository->shouldReceive('destroy')->andReturn(true);
-
- $this->session(['bills.delete.url' => 'http://localhost']);
- $this->be($this->user());
- $this->call('post', route('bills.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BillController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('GET', route('bills.edit', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BillController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('GET', route('bills.index'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BillController::rescan
- */
- public function testRescan()
- {
- $repository = $this->mock(BillRepositoryInterface::class);
- $repository->shouldReceive('getPossiblyRelatedJournals')->once()->andReturn(new Collection);
- $this->be($this->user());
- $this->call('GET', route('bills.rescan', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BillController::show
- */
- public function testShow()
- {
- $this->be($this->user());
- $this->call('GET', route('bills.show', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BillController::store
- */
- public function testStore()
- {
- $data = [
- 'name' => 'New Bill ' . rand(1000, 9999),
- 'match' => 'some words',
- 'amount_min' => '100',
- 'amount_currency_id_amount_min' => 1,
- 'amount_currency_id_amount_max' => 1,
- 'skip' => 0,
- 'amount_max' => '100',
- 'date' => '2016-01-01',
- 'repeat_freq' => 'monthly',
- ];
- $this->session(['bills.create.url' => 'http://localhost']);
- $this->be($this->user());
- $this->call('post', route('bills.store'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- // list must be updated
- $this->be($this->user());
- $this->call('GET', route('bills.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- $this->see($data['name']);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BillController::update
- */
- public function testUpdate()
- {
- $data = [
- 'name' => 'Updated Bill ' . rand(1000, 9999),
- 'match' => 'some more words',
- 'amount_min' => '100',
- 'amount_currency_id_amount_min' => 1,
- 'amount_currency_id_amount_max' => 1,
- 'skip' => 0,
- 'amount_max' => '100',
- 'date' => '2016-01-01',
- 'repeat_freq' => 'monthly',
- ];
- $this->session(['bills.edit.url' => 'http://localhost']);
- $this->be($this->user());
- $this->call('post', route('bills.update', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- // list must be updated
- $this->be($this->user());
- $this->call('GET', route('bills.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- $this->see($data['name']);
- }
-
-}
diff --git a/tests/acceptance/Controllers/BudgetControllerTest.php b/tests/acceptance/Controllers/BudgetControllerTest.php
deleted file mode 100644
index 25f0f3b91a..0000000000
--- a/tests/acceptance/Controllers/BudgetControllerTest.php
+++ /dev/null
@@ -1,283 +0,0 @@
- 200,
- ];
- $this->be($this->user());
- $this->call('post', route('budgets.amount', [1]), $data);
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::create
- */
- public function testCreate()
- {
- $this->be($this->user());
- $this->call('GET', route('budgets.create'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('GET', route('budgets.delete', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::destroy
- */
- public function testDestroy()
- {
- $this->session(['budgets.delete.url' => 'http://localhost']);
-
- $repository = $this->mock(BudgetRepositoryInterface::class);
- $repository->shouldReceive('destroy')->andReturn(true);
-
- $this->be($this->user());
- $this->call('post', route('budgets.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('GET', route('budgets.edit', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::index
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testIndex(string $range)
- {
- $repository = $this->mock(BudgetRepositoryInterface::class);
- $repository->shouldReceive('cleanupBudgets');
- $repository->shouldReceive('getActiveBudgets')->andReturn(new Collection);
- $repository->shouldReceive('getInactiveBudgets')->andReturn(new Collection);
- $repository->shouldReceive('getAvailableBudget')->andReturn('100.123');
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('budgets.index'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::noBudget
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testNoBudget(string $range)
- {
- $date = new Carbon();
- $this->session(['start' => $date, 'end' => clone $date]);
-
- $collector = $this->mock(JournalCollectorInterface::class);
- $collector->shouldReceive('setAllAssetAccounts')->andReturnSelf();
- $collector->shouldReceive('setRange')->andReturnSelf();
- $collector->shouldReceive('setLimit')->andReturnSelf();
- $collector->shouldReceive('setPage')->andReturnSelf();
- $collector->shouldReceive('withoutBudget')->andReturnSelf();
- $collector->shouldReceive('withCategoryInformation')->andReturnSelf();
- $collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('budgets.no-budget'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::postUpdateIncome
- */
- public function testPostUpdateIncome()
- {
- $data = [
- 'amount' => '200',
- ];
- $this->be($this->user());
- $this->call('post', route('budgets.income.post'), $data);
- $this->assertResponseStatus(302);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::show
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testShow(string $range)
- {
- $date = new Carbon();
- $date->subDay();
- $this->session(['first' => $date]);
-
- // mock account repository
- $accountRepository = $this->mock(AccountRepositoryInterface::class);
- $accountRepository->shouldReceive('getAccountsByType')->andReturn(new Collection);
-
-
- // mock budget repository
- $budgetRepository = $this->mock(BudgetRepositoryInterface::class);
- $budgetRepository->shouldReceive('getBudgetLimits')->andReturn(new Collection);
- $budgetRepository->shouldReceive('spentInPeriod')->andReturn('1');
- // mock journal collector:
- $collector = $this->mock(JournalCollectorInterface::class);
- $collector->shouldReceive('setAllAssetAccounts')->andReturnSelf();
- $collector->shouldReceive('setRange')->andReturnSelf();
- $collector->shouldReceive('setLimit')->andReturnSelf();
- $collector->shouldReceive('setPage')->andReturnSelf();
- $collector->shouldReceive('setBudget')->andReturnSelf();
- $collector->shouldReceive('withCategoryInformation')->andReturnSelf();
- $collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('budgets.show', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::showByBudgetLimit()
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testShowByBudgetLimit(string $range)
- {
- // mock account repository
- $accountRepository = $this->mock(AccountRepositoryInterface::class);
- $accountRepository->shouldReceive('getAccountsByType')->andReturn(new Collection);
-
- // mock budget repository
- $budgetRepository = $this->mock(BudgetRepositoryInterface::class);
- $budgetRepository->shouldReceive('spentInPeriod')->andReturn('1');
- $budgetRepository->shouldReceive('getBudgetLimits')->andReturn(new Collection);
-
- // mock journal collector:
- $collector = $this->mock(JournalCollectorInterface::class);
- $collector->shouldReceive('setAllAssetAccounts')->andReturnSelf();
- $collector->shouldReceive('setRange')->andReturnSelf();
- $collector->shouldReceive('setLimit')->andReturnSelf();
- $collector->shouldReceive('setPage')->andReturnSelf();
- $collector->shouldReceive('setBudget')->andReturnSelf();
- $collector->shouldReceive('withCategoryInformation')->andReturnSelf();
- $collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('budgets.show.limit', [1, 1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::store
- */
- public function testStore()
- {
- $this->session(['budgets.create.url' => 'http://localhost']);
-
- $data = [
- 'name' => 'New Budget ' . rand(1000, 9999),
- ];
- $this->be($this->user());
- $this->call('post', route('budgets.store'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::update
- */
- public function testUpdate()
- {
- $this->session(['budgets.edit.url' => 'http://localhost']);
-
- $data = [
- 'name' => 'Updated Budget ' . rand(1000, 9999),
- 'active' => 1,
- ];
- $this->be($this->user());
- $this->call('post', route('budgets.update', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::updateIncome
- */
- public function testUpdateIncome()
- {
- // must be in list
- $this->be($this->user());
- $this->call('GET', route('budgets.income', [1]));
- $this->assertResponseStatus(200);
- }
-
-}
diff --git a/tests/acceptance/Controllers/CategoryControllerTest.php b/tests/acceptance/Controllers/CategoryControllerTest.php
deleted file mode 100644
index da294075d4..0000000000
--- a/tests/acceptance/Controllers/CategoryControllerTest.php
+++ /dev/null
@@ -1,257 +0,0 @@
-be($this->user());
- $this->call('GET', route('categories.create'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('GET', route('categories.delete', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::destroy
- */
- public function testDestroy()
- {
- $this->session(['categories.delete.url' => 'http://localhost']);
- $repository = $this->mock(CategoryRepositoryInterface::class);
- $repository->shouldReceive('destroy')->andReturn(true);
-
- $this->be($this->user());
- $this->call('post', route('categories.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('GET', route('categories.edit', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('GET', route('categories.index'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::noCategory
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testNoCategory(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('categories.no-category'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::show
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testShow(string $range)
- {
-
- $collector = $this->mock(JournalCollectorInterface::class);
- $accRepository = $this->mock(AccountRepositoryInterface::class);
- $catRepository = $this->mock(CategoryRepositoryInterface::class);
-
- $accRepository->shouldReceive('getAccountsByType')->once()->andReturn(new Collection);
- $catRepository->shouldReceive('firstUseDate')->once()->andReturn(new Carbon);
-
- // collector stuff:
- $collector->shouldReceive('setPage')->andReturnSelf()->once();
- $collector->shouldReceive('setLimit')->andReturnSelf()->once();
- $collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once();
- $collector->shouldReceive('setRange')->andReturnSelf()->once();
- $collector->shouldReceive('withBudgetInformation')->andReturnSelf()->once();
- $collector->shouldReceive('setCategory')->andReturnSelf()->once();
- $collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->once();
-
- // more repos stuff:
- $catRepository->shouldReceive('spentInPeriod')->andReturn('0');
- $catRepository->shouldReceive('earnedInPeriod')->andReturn('0');
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('categories.show', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::showAll
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testShowAll(string $range)
- {
- $collector = $this->mock(JournalCollectorInterface::class);
-
- // collector stuff:
- $collector->shouldReceive('setPage')->andReturnSelf()->once();
- $collector->shouldReceive('setLimit')->andReturnSelf()->once();
- $collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once();
- $collector->shouldReceive('withBudgetInformation')->andReturnSelf()->once();
- $collector->shouldReceive('setCategory')->andReturnSelf()->once();
- $collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->once();
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('categories.show.all', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::showByDate
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testShowByDate(string $range)
- {
- $collector = $this->mock(JournalCollectorInterface::class);
-
- // collector stuff:
- $collector->shouldReceive('setPage')->andReturnSelf()->once();
- $collector->shouldReceive('setLimit')->andReturnSelf()->once();
- $collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once();
- $collector->shouldReceive('setRange')->andReturnSelf()->once();
- $collector->shouldReceive('withBudgetInformation')->andReturnSelf()->once();
- $collector->shouldReceive('setCategory')->andReturnSelf()->once();
- $collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->once();
-
- // mock category repository
- $repository = $this->mock(CategoryRepositoryInterface::class);
- $repository->shouldReceive('firstUseDate')->once()->andReturn(new Carbon);
- $repository->shouldReceive('spentInPeriod')->andReturn('-1');
- $repository->shouldReceive('earnedInPeriod')->andReturn('1');
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('categories.show.date', [1, '2015-01-01']));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::store
- */
- public function testStore()
- {
- $this->session(['categories.create.url' => 'http://localhost']);
-
- $data = [
- 'name' => 'New Category ' . rand(1000, 9999),
- ];
- $this->be($this->user());
- $this->call('post', route('categories.store'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- // must be in list
- $this->be($this->user());
- $this->call('GET', route('categories.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- $this->see($data['name']);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::update
- */
- public function testUpdate()
- {
- $this->session(['categories.edit.url' => 'http://localhost']);
-
- $data = [
- 'name' => 'Updated Category ' . rand(1000, 9999),
- 'active' => 1,
- ];
- $this->be($this->user());
- $this->call('post', route('categories.update', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- // must be in list
- $this->be($this->user());
- $this->call('GET', route('categories.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- $this->see($data['name']);
- }
-
-}
diff --git a/tests/acceptance/Controllers/Chart/AccountControllerTest.php b/tests/acceptance/Controllers/Chart/AccountControllerTest.php
deleted file mode 100644
index ab19fe167b..0000000000
--- a/tests/acceptance/Controllers/Chart/AccountControllerTest.php
+++ /dev/null
@@ -1,154 +0,0 @@
-be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.account.expense'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\AccountController::expenseBudget
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testExpenseBudget(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.account.expense-budget', [1, '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\AccountController::expenseCategory
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testExpenseCategory(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.account.expense-category', [1, '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\AccountController::frontpage
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testFrontpage(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.account.frontpage'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\AccountController::incomeCategory
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testIncomeCategory(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.account.income-category', [1, '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\AccountController::period
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testPeriod(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.account.period', [1, '2012-01-01']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\AccountController::report
- */
- public function testReport()
- {
- $this->be($this->user());
- $this->call('get', route('chart.account.report', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\AccountController::revenueAccounts
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testRevenueAccounts(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.account.revenue'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\AccountController::single
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testSingle(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.account.single', [1]));
- $this->assertResponseStatus(200);
- }
-
-}
diff --git a/tests/acceptance/Controllers/Chart/BillControllerTest.php b/tests/acceptance/Controllers/Chart/BillControllerTest.php
deleted file mode 100644
index 657c934f28..0000000000
--- a/tests/acceptance/Controllers/Chart/BillControllerTest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.bill.frontpage'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\BillController::single
- */
- public function testSingle()
- {
- $this->be($this->user());
- $this->call('get', route('chart.bill.single', [1]));
- $this->assertResponseStatus(200);
- }
-
-}
diff --git a/tests/acceptance/Controllers/Chart/BudgetControllerTest.php b/tests/acceptance/Controllers/Chart/BudgetControllerTest.php
deleted file mode 100644
index dd9b49586b..0000000000
--- a/tests/acceptance/Controllers/Chart/BudgetControllerTest.php
+++ /dev/null
@@ -1,103 +0,0 @@
-mock(BudgetRepositoryInterface::class);
- $budgetRepository->shouldReceive('firstUseDate')->andReturn(new Carbon('2015-01-01'));
- $budgetRepository->shouldReceive('spentInPeriod')->andReturn('-100');
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.budget.budget', [1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\BudgetController::budgetLimit
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testBudgetLimit(string $range)
- {
- $budgetRepository = $this->mock(BudgetRepositoryInterface::class);
- $budgetRepository->shouldReceive('spentInPeriod')->andReturn('-100');
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.budget.budget-limit', [1,1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\BudgetController::frontpage
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testFrontpage(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.budget.frontpage'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\BudgetController::period
- */
- public function testPeriod()
- {
- $this->be($this->user());
- $this->call('get', route('chart.budget.period', [1,'1','20120101','20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\BudgetController::periodNoBudget
- */
- public function testPeriodNoBudget()
- {
- $this->be($this->user());
- $this->call('get', route('chart.budget.period.no-budget', ['1','20120101','20120131']));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/Chart/CategoryControllerTest.php b/tests/acceptance/Controllers/Chart/CategoryControllerTest.php
deleted file mode 100644
index 06af5d366c..0000000000
--- a/tests/acceptance/Controllers/Chart/CategoryControllerTest.php
+++ /dev/null
@@ -1,148 +0,0 @@
-mock(CategoryRepositoryInterface::class);
-
- $catRepository->shouldReceive('spentInPeriod')->andReturn('0');
- $catRepository->shouldReceive('earnedInPeriod')->andReturn('0');
- $catRepository->shouldReceive('firstUseDate')->andReturn(new Carbon);
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.category.all', [1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryController::currentPeriod
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryController::makePeriodChart
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testCurrentPeriod(string $range)
- {
- // this is actually for makePeriodChart
- $accountRepository = $this->mock(AccountRepositoryInterface::class);
- $categoryRepository = $this->mock(CategoryRepositoryInterface::class);
- $account = $this->user()->accounts()->where('account_type_id', 5)->first();
- $accountRepository->shouldReceive('getAccountsByType')->andReturn(new Collection([$account]));
- $categoryRepository->shouldReceive('spentInPeriod')->andReturn('0');
- $categoryRepository->shouldReceive('earnedInPeriod')->andReturn('0');
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.category.current', [1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryController::frontpage
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testFrontpage(string $range)
- {
- $accountRepository = $this->mock(AccountRepositoryInterface::class);
- $categoryRepository = $this->mock(CategoryRepositoryInterface::class);
- $category = $this->user()->categories()->first();
- $account = $this->user()->accounts()->where('account_type_id', 5)->first();
- // get one category
- $categoryRepository->shouldReceive('getCategories')->andReturn(new Collection([$category]));
- // get one account
- $accountRepository->shouldReceive('getAccountsByType')->andReturn(new Collection([$account]));
- // always return zero
- $categoryRepository->shouldReceive('spentInPeriod')->andReturn('0');
- $categoryRepository->shouldReceive('spentInPeriodWithoutCategory')->andReturn('0');
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.category.frontpage', [1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryController::reportPeriod
- */
- public function testReportPeriod()
- {
- $this->be($this->user());
- $this->call('get', route('chart.category.period', [1, '1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryController::reportPeriodNoCategory
- */
- public function testReportPeriodNoCategory()
- {
- $this->be($this->user());
- $this->call('get', route('chart.category.period.no-category', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryController::specificPeriod
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryController::makePeriodChart
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testSpecificPeriod(string $range)
- {
- $accountRepository = $this->mock(AccountRepositoryInterface::class);
- $categoryRepository = $this->mock(CategoryRepositoryInterface::class);
- $account = $this->user()->accounts()->where('account_type_id', 5)->first();
- $accountRepository->shouldReceive('getAccountsByType')->andReturn(new Collection([$account]));
- $categoryRepository->shouldReceive('spentInPeriod')->andReturn('0');
- $categoryRepository->shouldReceive('earnedInPeriod')->andReturn('0');
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.category.specific', ['1', '2012-01-01']));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/Chart/CategoryReportControllerTest.php b/tests/acceptance/Controllers/Chart/CategoryReportControllerTest.php
deleted file mode 100644
index ba948c67ae..0000000000
--- a/tests/acceptance/Controllers/Chart/CategoryReportControllerTest.php
+++ /dev/null
@@ -1,82 +0,0 @@
-be($this->user());
- $this->call('get', route('chart.category.account-expense', ['1', '1', '20120101', '20120131', 0]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::accountIncome
- */
- public function testAccountIncome()
- {
- $this->be($this->user());
- $this->call('get', route('chart.category.account-income', ['1', '1', '20120101', '20120131', 0]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::categoryExpense
- */
- public function testCategoryExpense()
- {
- $this->be($this->user());
- $this->call('get', route('chart.category.category-expense', ['1', '1', '20120101', '20120131', 0]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::categoryIncome
- */
- public function testCategoryIncome()
- {
- $this->be($this->user());
- $this->call('get', route('chart.category.category-income', ['1', '1', '20120101', '20120131', 0]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::mainChart
- */
- public function testMainChart()
- {
- $this->be($this->user());
- $this->call('get', route('chart.category.main', ['1', '1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
-}
diff --git a/tests/acceptance/Controllers/Chart/PiggyBankControllerTest.php b/tests/acceptance/Controllers/Chart/PiggyBankControllerTest.php
deleted file mode 100644
index f368213e00..0000000000
--- a/tests/acceptance/Controllers/Chart/PiggyBankControllerTest.php
+++ /dev/null
@@ -1,41 +0,0 @@
-be($this->user());
- $this->call('get', route('chart.piggy-bank.history', [1]));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/Chart/ReportControllerTest.php b/tests/acceptance/Controllers/Chart/ReportControllerTest.php
deleted file mode 100644
index 7b782367bc..0000000000
--- a/tests/acceptance/Controllers/Chart/ReportControllerTest.php
+++ /dev/null
@@ -1,61 +0,0 @@
-be($this->user());
- $this->call('get', route('chart.report.net-worth', [1, '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\ReportController::operations
- */
- public function testOperations()
- {
- $this->be($this->user());
- $this->call('get', route('chart.report.operations', [1, '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\ReportController::sum
- */
- public function testSum()
- {
- $this->be($this->user());
- $this->call('get', route('chart.report.sum', [1, '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/CurrencyControllerTest.php b/tests/acceptance/Controllers/CurrencyControllerTest.php
deleted file mode 100644
index 36d14bacde..0000000000
--- a/tests/acceptance/Controllers/CurrencyControllerTest.php
+++ /dev/null
@@ -1,140 +0,0 @@
-be($this->user());
- $this->call('GET', route('currencies.create'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CurrencyController::defaultCurrency
- */
- public function testDefaultCurrency()
- {
- $this->be($this->user());
- $this->call('GET', route('currencies.default', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CurrencyController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('GET', route('currencies.delete', [2]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CurrencyController::destroy
- */
- public function testDestroy()
- {
- $this->session(['currencies.delete.url' => 'http://localhost']);
- $repository = $this->mock(CurrencyRepositoryInterface::class);
- $repository->shouldReceive('canDeleteCurrency')->andReturn(true);
- $repository->shouldReceive('destroy')->andReturn(true);
-
- $this->be($this->user());
- $this->call('post', route('currencies.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CurrencyController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('GET', route('currencies.edit', [2]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CurrencyController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('GET', route('currencies.index'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CurrencyController::store
- */
- public function testStore()
- {
- $this->session(['currencies.create.url' => 'http://localhost']);
- $data = [
- 'name' => 'XX',
- 'code' => 'XXX',
- 'symbol' => 'x',
- 'decimal_places' => 2,
- ];
- $this->be($this->user());
- $this->call('post', route('currencies.store'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CurrencyController::update
- */
- public function testUpdate()
- {
- $this->session(['currencies.edit.url' => 'http://localhost']);
- $data = [
- 'name' => 'XA',
- 'code' => 'XAX',
- 'symbol' => 'a',
- 'decimal_places' => 2,
- ];
- $this->be($this->user());
- $this->call('post', route('currencies.update', [2]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-}
diff --git a/tests/acceptance/Controllers/ExportControllerTest.php b/tests/acceptance/Controllers/ExportControllerTest.php
deleted file mode 100644
index 39a7bd4ebc..0000000000
--- a/tests/acceptance/Controllers/ExportControllerTest.php
+++ /dev/null
@@ -1,111 +0,0 @@
-mock(ExportJobRepositoryInterface::class);
- $repository->shouldReceive('exists')->once()->andReturn(true);
- $repository->shouldReceive('getContent')->once()->andReturn('Some content beep boop');
-
- $this->be($this->user());
- $this->call('GET', route('export.download', ['testExport']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ExportController::getStatus
- */
- public function testGetStatus()
- {
- $this->be($this->user());
- $this->call('GET', route('export.status', ['testExport']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ExportController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('GET', route('export.index'));
- $this->assertResponseStatus(200);
-
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ExportController::postIndex
- */
- public function testPostIndex()
- {
- $this->session(
- ['first' => new Carbon('2014-01-01')]
- );
-
-
- $data = [
-
- 'export_start_range' => '2015-01-01',
- 'export_end_range' => '2015-01-21',
- 'exportFormat' => 'csv',
- 'accounts' => [1],
- 'job' => 'testExport',
- ];
-
- $accountRepository = $this->mock(AccountRepositoryInterface::class);
- $accountRepository->shouldReceive('getAccountsById')->withArgs([$data['accounts']])->andReturn(new Collection);
-
- $processor = $this->mock(ProcessorInterface::class);
- $processor->shouldReceive('collectJournals')->once();
- $processor->shouldReceive('convertJournals')->once();
- $processor->shouldReceive('exportJournals')->once();
- $processor->shouldReceive('createZipFile')->once();
-
- $repository = $this->mock(ExportJobRepositoryInterface::class);
- $repository->shouldReceive('changeStatus')->andReturn(true);
- $repository->shouldReceive('findByKey')->andReturn(new ExportJob);
-
- $this->be($this->user());
-
- $this->call('post', route('export.export'), $data);
- $this->assertResponseStatus(200);
- $this->see('ok');
- }
-
-}
diff --git a/tests/acceptance/Controllers/HelpControllerTest.php b/tests/acceptance/Controllers/HelpControllerTest.php
deleted file mode 100644
index 9acadb6482..0000000000
--- a/tests/acceptance/Controllers/HelpControllerTest.php
+++ /dev/null
@@ -1,45 +0,0 @@
-mock(HelpInterface::class);
- $help->shouldReceive('hasRoute')->andReturn(true)->once();
- $help->shouldReceive('inCache')->andReturn(false)->once();
- $help->shouldReceive('getFromGithub')->andReturn('Help content here.')->once();
- $help->shouldReceive('putInCache')->once();
-
- $this->be($this->user());
- $this->call('GET', route('help.show', ['index']));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/HomeControllerTest.php b/tests/acceptance/Controllers/HomeControllerTest.php
deleted file mode 100644
index 5babd78d5c..0000000000
--- a/tests/acceptance/Controllers/HomeControllerTest.php
+++ /dev/null
@@ -1,96 +0,0 @@
-be($this->user());
-
- $args = [
- 'start' => '2012-01-01',
- 'end' => '2012-04-01',
- ];
-
- $this->call('POST', route('daterange'), $args);
- $this->assertResponseStatus(200);
- $this->assertSessionHas('warning', '91 days of data may take a while to load.');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\HomeController::displayError
- */
- public function testDisplayError()
- {
- $this->be($this->user());
- $this->call('GET', route('error'));
- $this->assertResponseStatus(500);
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\HomeController::flush
- */
- public function testFlush()
- {
- $this->be($this->user());
- $this->call('GET', route('flush'));
- $this->assertResponseStatus(302);
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\HomeController::index
- * @covers FireflyIII\Http\Controllers\Controller::__construct
- * @dataProvider dateRangeProvider
- *
- * @param $range
- */
- public function testIndex(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('index'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\HomeController::routes
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testRoutes(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('all-routes'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\HomeController::testFlash
- */
- public function testTestFlash()
- {
- $this->be($this->user());
- $this->call('GET', route('test-flash'));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertSessionHas('info');
- $this->assertSessionHas('warning');
- $this->assertSessionHas('error');
- }
-}
diff --git a/tests/acceptance/Controllers/ImportControllerTest.php b/tests/acceptance/Controllers/ImportControllerTest.php
deleted file mode 100644
index 4c4c4dda3d..0000000000
--- a/tests/acceptance/Controllers/ImportControllerTest.php
+++ /dev/null
@@ -1,177 +0,0 @@
-be($this->user());
- $this->call('GET', route('import.complete', ['complete']));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::configure
- */
- public function testConfigure()
- {
- $this->be($this->user());
- $this->call('GET', route('import.configure', ['configure']));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::download
- */
- public function testDownload()
- {
- $this->be($this->user());
- $this->call('GET', route('import.download', ['configure']));
- $this->assertResponseStatus(200);
- $this->see('[]');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::finished
- */
- public function testFinished()
- {
- $this->be($this->user());
- $this->call('GET', route('import.finished', ['finished']));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('GET', route('import.index'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::json
- */
- public function testJson()
- {
- $this->be($this->user());
- $this->call('GET', route('import.json', ['configure']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::postConfigure
- */
- public function testPostConfigure()
- {
- $importer = $this->mock(CsvSetup::class);
- $importer->shouldReceive('setJob')->once();
- $importer->shouldReceive('saveImportConfiguration')->once();
-
- $data = [];
- $this->be($this->user());
- $this->call('post', route('import.process-configuration', ['p-configure']), $data);
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('import.settings', ['p-configure']);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::postSettings
- */
- public function testPostSettings()
- {
- $importer = $this->mock(CsvSetup::class);
- $importer->shouldReceive('setJob')->once();
- $importer->shouldReceive('storeSettings')->once();
- $data = [];
- $this->be($this->user());
- $this->call('post', route('import.post-settings', ['p-settings']), $data);
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('import.settings', ['p-settings']);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::settings
- */
- public function testSettings()
- {
- $importer = $this->mock(CsvSetup::class);
- $importer->shouldReceive('setJob')->once();
- $importer->shouldReceive('requireUserSettings')->once()->andReturn(false);
- $this->be($this->user());
- $this->call('get', route('import.settings', ['settings']));
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('import.complete', ['settings']);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::start
- */
- public function testStart()
- {
- /** @var ImportProcedureInterface $procedure */
- $procedure = $this->mock(ImportProcedureInterface::class);
-
- $procedure->shouldReceive('runImport');
-
- $this->be($this->user());
- $this->call('post', route('import.start', ['complete']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::status
- * Implement testStatus().
- */
- public function testStatus()
- {
- // complete
- $this->be($this->user());
- $this->call('get', route('import.status', ['complete']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::upload
- */
- public function testUpload()
- {
- $path = resource_path('stubs/csv.csv');
- $file = new UploadedFile($path, 'upload.csv', filesize($path), 'text/csv', null, true);
- $this->call('POST', route('import.upload'), [], [], ['import_file' => $file], ['Accept' => 'application/json']);
- $this->assertResponseStatus(302);
- }
-}
diff --git a/tests/acceptance/Controllers/JsonControllerTest.php b/tests/acceptance/Controllers/JsonControllerTest.php
deleted file mode 100644
index bcd30afada..0000000000
--- a/tests/acceptance/Controllers/JsonControllerTest.php
+++ /dev/null
@@ -1,158 +0,0 @@
-be($this->user());
- $this->call('get', route('json.action'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::boxBillsPaid
- */
- public function testBoxBillsPaid()
- {
- $this->be($this->user());
- $this->call('get', route('json.box.paid'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::boxBillsUnpaid
- */
- public function testBoxBillsUnpaid()
- {
- $this->be($this->user());
- $this->call('get', route('json.box.unpaid'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::boxIn
- */
- public function testBoxIn()
- {
- $this->be($this->user());
- $this->call('get', route('json.box.in'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::boxOut
- */
- public function testBoxOut()
- {
- $this->be($this->user());
- $this->call('get', route('json.box.out'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::categories
- */
- public function testCategories()
- {
- $this->be($this->user());
- $this->call('get', route('json.categories'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::endTour
- */
- public function testEndTour()
- {
- $this->be($this->user());
- $this->call('post', route('json.end-tour'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::expenseAccounts
- */
- public function testExpenseAccounts()
- {
- $this->be($this->user());
- $this->call('get', route('json.expense-accounts'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::revenueAccounts
- */
- public function testRevenueAccounts()
- {
- $this->be($this->user());
- $this->call('get', route('json.revenue-accounts'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::tags
- */
- public function testTags()
- {
- $this->be($this->user());
- $this->call('get', route('json.tags'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::tour
- */
- public function testTour()
- {
- $this->be($this->user());
- $this->call('get', route('json.tour'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::transactionJournals
- */
- public function testTransactionJournals()
- {
- $this->be($this->user());
- $this->call('get', route('json.transaction-journals', ['deposit']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::trigger
- */
- public function testTrigger()
- {
- $this->be($this->user());
- $this->call('get', route('json.trigger'));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/NewUserControllerTest.php b/tests/acceptance/Controllers/NewUserControllerTest.php
deleted file mode 100644
index 7c98ec5583..0000000000
--- a/tests/acceptance/Controllers/NewUserControllerTest.php
+++ /dev/null
@@ -1,55 +0,0 @@
-be($this->emptyUser());
- $this->call('get', route('new-user.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\NewUserController::submit
- */
- public function testSubmit()
- {
- $data = [
- 'bank_name' => 'New bank',
- 'bank_balance' => 100,
- ];
- $this->be($this->emptyUser());
- $this->call('post', route('new-user.submit'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
-}
diff --git a/tests/acceptance/Controllers/PiggyBankControllerTest.php b/tests/acceptance/Controllers/PiggyBankControllerTest.php
deleted file mode 100644
index d480600d21..0000000000
--- a/tests/acceptance/Controllers/PiggyBankControllerTest.php
+++ /dev/null
@@ -1,241 +0,0 @@
-be($this->user());
- $this->call('get', route('piggy-banks.add', [1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::addMobile
- */
- public function testAddMobile()
- {
- $this->be($this->user());
- $this->call('get', route('piggy-banks.add-money-mobile', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::create
- */
- public function testCreate()
- {
- $this->be($this->user());
- $this->call('get', route('piggy-banks.create'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('get', route('piggy-banks.delete', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::destroy
- */
- public function testDestroy()
- {
- $repository = $this->mock(PiggyBankRepositoryInterface::class);
- $repository->shouldReceive('destroy')->andReturn(true);
-
- $this->session(['piggy-banks.delete.url' => 'http://localhost']);
- $this->be($this->user());
- $this->call('post', route('piggy-banks.destroy', [2]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertRedirectedToRoute('index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('get', route('piggy-banks.edit', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('get', route('piggy-banks.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::order
- */
- public function testOrder()
- {
- $this->be($this->user());
- $this->call('post', route('piggy-banks.order', [1, 2]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::postAdd
- */
- public function testPostAdd()
- {
- $data = ['amount' => '1.123'];
- $this->be($this->user());
- $this->call('post', route('piggy-banks.add', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('piggy-banks.index');
- $this->assertSessionHas('success');
- }
-
- /**
- * Add the exact amount to fill a piggy bank
- *
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::postAdd
- */
- public function testPostAddExact()
- {
- // find a piggy with current amount = 0.
- $piggy = PiggyBank::leftJoin('piggy_bank_repetitions', 'piggy_bank_repetitions.piggy_bank_id', '=', 'piggy_banks.id')
- ->where('currentamount', 0)
- ->first(['piggy_banks.id', 'targetamount']);
-
-
- $data = ['amount' => strval($piggy->targetamount)];
- $this->be($this->user());
- $this->call('post', route('piggy-banks.add', [$piggy->id]), $data);
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('piggy-banks.index');
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::postRemove
- */
- public function testPostRemove()
- {
- $data = ['amount' => '1.123'];
- $this->be($this->user());
- $this->call('post', route('piggy-banks.remove', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('piggy-banks.index');
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::remove
- */
- public function testRemove()
- {
- $this->be($this->user());
- $this->call('get', route('piggy-banks.remove', [1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::removeMobile
- */
- public function testRemoveMobile()
- {
- $this->be($this->user());
- $this->call('get', route('piggy-banks.remove-money-mobile', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::show
- */
- public function testShow()
- {
- $this->be($this->user());
- $this->call('get', route('piggy-banks.show', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::store
- */
- public function testStore()
- {
- $this->session(['piggy-banks.create.url' => 'http://localhost']);
- $data = [
- 'name' => 'Piggy ' . rand(999, 10000),
- 'targetamount' => '100.123',
- 'account_id' => 2,
- 'amount_currency_id_targetamount' => 1,
-
- ];
- $this->be($this->user());
- $this->call('post', route('piggy-banks.store'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertRedirectedToRoute('index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::update
- */
- public function testUpdate()
- {
- $this->session(['piggy-banks.edit.url' => 'http://localhost']);
- $data = [
- 'name' => 'Updated Piggy ' . rand(999, 10000),
- 'targetamount' => '100.123',
- 'account_id' => 2,
- 'amount_currency_id_targetamount' => 1,
-
- ];
- $this->be($this->user());
- $this->call('post', route('piggy-banks.update', [3]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertRedirectedToRoute('index');
- }
-
-}
diff --git a/tests/acceptance/Controllers/Popup/ReportControllerTest.php b/tests/acceptance/Controllers/Popup/ReportControllerTest.php
deleted file mode 100644
index e601cc167e..0000000000
--- a/tests/acceptance/Controllers/Popup/ReportControllerTest.php
+++ /dev/null
@@ -1,149 +0,0 @@
-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);
- $this->call('get', $uri);
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Popup\ReportController::general
- */
- public function testBudgetSpentAmount()
- {
-
- $this->be($this->user());
- $arguments = [
- 'attributes' => [
- 'location' => 'budget-spent-amount',
- 'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
- 'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
- 'accounts' => 1,
- 'accountId' => 1,
- 'categoryId' => 1,
- 'budgetId' => 1,
- ],
- ];
- $uri = route('popup.general') . '?' . http_build_query($arguments);
- $this->call('get', $uri);
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Popup\ReportController::general
- */
- public function testCategoryEntry()
- {
-
- $this->be($this->user());
- $arguments = [
- 'attributes' => [
- 'location' => 'category-entry',
- 'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
- 'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
- 'accounts' => 1,
- 'accountId' => 1,
- 'categoryId' => 1,
- 'budgetId' => 1,
- ],
- ];
- $uri = route('popup.general') . '?' . http_build_query($arguments);
- $this->call('get', $uri);
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Popup\ReportController::general
- */
- public function testExpenseEntry()
- {
-
- $this->be($this->user());
- $arguments = [
- 'attributes' => [
- 'location' => 'expense-entry',
- 'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
- 'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
- 'accounts' => 1,
- 'accountId' => 1,
- 'categoryId' => 1,
- 'budgetId' => 1,
- ],
- ];
- $uri = route('popup.general') . '?' . http_build_query($arguments);
- $this->call('get', $uri);
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Popup\ReportController::general
- */
- public function testIncomeEntry()
- {
-
- $this->be($this->user());
- $arguments = [
- 'attributes' => [
- 'location' => 'income-entry',
- 'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
- 'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
- 'accounts' => 1,
- 'accountId' => 1,
- 'categoryId' => 1,
- 'budgetId' => 1,
- ],
- ];
- $uri = route('popup.general') . '?' . http_build_query($arguments);
- $this->call('get', $uri);
- $this->assertResponseStatus(200);
- }
-
-}
diff --git a/tests/acceptance/Controllers/PreferencesControllerTest.php b/tests/acceptance/Controllers/PreferencesControllerTest.php
deleted file mode 100644
index 782453bd0d..0000000000
--- a/tests/acceptance/Controllers/PreferencesControllerTest.php
+++ /dev/null
@@ -1,87 +0,0 @@
-be($this->user());
- $this->call('get', route('preferences.code'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PreferencesController::deleteCode
- */
- public function testDeleteCode()
- {
- $this->be($this->user());
- $this->call('get', route('preferences.delete-code'));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertSessionHas('info');
- $this->assertRedirectedToRoute('preferences.index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PreferencesController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('get', route('preferences.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PreferencesController::postIndex
- */
- public function testPostIndex()
- {
- $data = [
- 'fiscalYearStart' => '2016-01-01',
- 'frontPageAccounts' => [],
- 'viewRange' => '1M',
- 'customFiscalYear' => 0,
- 'showDepositsFrontpage' => 0,
- 'transactionPageSize' => 100,
- 'twoFactorAuthEnabled' => 0,
- 'language' => 'en_US',
- 'tj' => [],
- ];
-
- $this->be($this->user());
- $this->call('post', route('preferences.update'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertRedirectedToRoute('preferences.index');
- }
-}
diff --git a/tests/acceptance/Controllers/ProfileControllerTest.php b/tests/acceptance/Controllers/ProfileControllerTest.php
deleted file mode 100644
index f11a4556a0..0000000000
--- a/tests/acceptance/Controllers/ProfileControllerTest.php
+++ /dev/null
@@ -1,97 +0,0 @@
-be($this->user());
- $this->call('get', route('profile.change-password'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ProfileController::deleteAccount
- */
- public function testDeleteAccount()
- {
- $this->be($this->user());
- $this->call('get', route('profile.delete-account'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ProfileController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('get', route('profile.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ProfileController::postChangePassword
- */
- public function testPostChangePassword()
- {
- $repository = $this->mock(UserRepositoryInterface::class);
- $repository->shouldReceive('changePassword');
-
- $data = [
- 'current_password' => 'james',
- 'new_password' => 'james2',
- 'new_password_confirmation' => 'james2',
- ];
- $this->be($this->user());
- $this->call('post', route('profile.change-password.post'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ProfileController::postDeleteAccount
- */
- public function testPostDeleteAccount()
- {
- $repository = $this->mock(UserRepositoryInterface::class);
- $repository->shouldReceive('destroy');
- $data = [
- 'password' => 'james',
- ];
- $this->be($this->user());
- $this->call('post', route('profile.delete-account.post'), $data);
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('index');
- }
-}
diff --git a/tests/acceptance/Controllers/Report/AccountControllerTest.php b/tests/acceptance/Controllers/Report/AccountControllerTest.php
deleted file mode 100644
index 40a1968bcf..0000000000
--- a/tests/acceptance/Controllers/Report/AccountControllerTest.php
+++ /dev/null
@@ -1,42 +0,0 @@
-be($this->user());
- $this->call('get', route('report-data.account.general', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
-}
diff --git a/tests/acceptance/Controllers/Report/BalanceControllerTest.php b/tests/acceptance/Controllers/Report/BalanceControllerTest.php
deleted file mode 100644
index aadfa39ec7..0000000000
--- a/tests/acceptance/Controllers/Report/BalanceControllerTest.php
+++ /dev/null
@@ -1,41 +0,0 @@
-be($this->user());
- $this->call('get', route('report-data.balance.general', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/Report/BudgetControllerTest.php b/tests/acceptance/Controllers/Report/BudgetControllerTest.php
deleted file mode 100644
index e13c2bf47c..0000000000
--- a/tests/acceptance/Controllers/Report/BudgetControllerTest.php
+++ /dev/null
@@ -1,51 +0,0 @@
-be($this->user());
- $this->call('get', route('report-data.budget.general', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Report\BudgetController::period
- */
- public function testPeriod()
- {
- $this->be($this->user());
- $this->call('get', route('report-data.budget.period', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/Report/CategoryControllerTest.php b/tests/acceptance/Controllers/Report/CategoryControllerTest.php
deleted file mode 100644
index 44f12f599d..0000000000
--- a/tests/acceptance/Controllers/Report/CategoryControllerTest.php
+++ /dev/null
@@ -1,61 +0,0 @@
-be($this->user());
- $this->call('get', route('report-data.category.expenses', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Report\CategoryController::income
- */
- public function testIncome()
- {
- $this->be($this->user());
- $this->call('get', route('report-data.category.income', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Report\CategoryController::operations
- */
- public function testOperations()
- {
- $this->be($this->user());
- $this->call('get', route('report-data.category.operations', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/Report/OperationsControllerTest.php b/tests/acceptance/Controllers/Report/OperationsControllerTest.php
deleted file mode 100644
index 027bc2a0e9..0000000000
--- a/tests/acceptance/Controllers/Report/OperationsControllerTest.php
+++ /dev/null
@@ -1,62 +0,0 @@
-be($this->user());
- $this->call('get', route('report-data.operations.expenses', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Report\OperationsController::income
- */
- public function testIncome()
- {
- $this->be($this->user());
- $this->call('get', route('report-data.operations.income', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Report\OperationsController::operations
- */
- public function testOperations()
- {
- $this->be($this->user());
- $this->call('get', route('report-data.operations.operations', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
-}
diff --git a/tests/acceptance/Controllers/ReportControllerTest.php b/tests/acceptance/Controllers/ReportControllerTest.php
deleted file mode 100644
index d975bb4581..0000000000
--- a/tests/acceptance/Controllers/ReportControllerTest.php
+++ /dev/null
@@ -1,105 +0,0 @@
-be($this->user());
- $this->call('get', route('reports.report.audit', [1, '20160101', '20160131']));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ReportController::budgetReport
- */
- public function testBudgetReport()
- {
- $this->be($this->user());
- $this->call('get', route('reports.report.budget', [1, 1, '20160101', '20160131']));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ReportController::categoryReport
- */
- public function testCategoryReport()
- {
- $this->be($this->user());
- $this->call('get', route('reports.report.category', [1, 1, '20160101', '20160131']));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ReportController::defaultReport
- */
- public function testDefaultReport()
- {
- $this->be($this->user());
- $this->call('get', route('reports.report.default', [1, '20160101', '20160131']));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ReportController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('get', route('reports.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ReportController::options
- */
- public function testOptions()
- {
- $this->be($this->user());
- $this->call('get', route('reports.options', ['default']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ReportController::postIndex
- */
- public function testPostIndex()
- {
- $this->be($this->user());
- $this->call('post', route('reports.index.post'));
- $this->assertResponseStatus(302);
- }
-}
diff --git a/tests/acceptance/Controllers/RuleControllerTest.php b/tests/acceptance/Controllers/RuleControllerTest.php
deleted file mode 100644
index 41ad37571c..0000000000
--- a/tests/acceptance/Controllers/RuleControllerTest.php
+++ /dev/null
@@ -1,228 +0,0 @@
-be($this->user());
- $this->call('get', route('rules.create', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('get', route('rules.delete', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::destroy
- */
- public function testDestroy()
- {
- $repository = $this->mock(RuleRepositoryInterface::class);
- $repository->shouldReceive('destroy');
-
- $this->session(['rules.delete.url' => 'http://localhost']);
- $this->be($this->user());
- $this->call('post', route('rules.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertRedirectedToRoute('index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::down
- */
- public function testDown()
- {
- $this->be($this->user());
- $this->call('get', route('rules.down', [1]));
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('rules.index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('get', route('rules.edit', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('get', route('rules.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::reorderRuleActions
- */
- public function testReorderRuleActions()
- {
- $data = [
- 'triggers' => [1, 2, 3],
- ];
-
- $repository = $this->mock(RuleRepositoryInterface::class);
- $repository->shouldReceive('reorderRuleActions');
-
- $this->be($this->user());
- $this->call('post', route('rules.reorder-actions', [1]), $data);
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::reorderRuleTriggers
- */
- public function testReorderRuleTriggers()
- {
- $data = [
- 'triggers' => [1, 2, 3],
- ];
-
- $repository = $this->mock(RuleRepositoryInterface::class);
- $repository->shouldReceive('reorderRuleTriggers');
-
- $this->be($this->user());
- $this->call('post', route('rules.reorder-triggers', [1]), $data);
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::store
- */
- public function testStore()
- {
- $this->session(['rules.create.url' => 'http://localhost']);
- $data = [
- 'rule_group_id' => 1,
- 'active' => 1,
- 'title' => 'A',
- 'trigger' => 'store-journal',
- 'description' => 'D',
- 'rule-trigger' => [
- 1 => 'from_account_starts',
- ],
- 'rule-trigger-value' => [
- 1 => 'B',
- ],
- 'rule-action' => [
- 1 => 'set_category',
- ],
- 'rule-action-value' => [
- 1 => 'C',
- ],
- ];
-
- $repository = $this->mock(RuleRepositoryInterface::class);
- $repository->shouldReceive('store')->andReturn(new Rule);
-
- $this->be($this->user());
- $this->call('post', route('rules.store', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * This actually hits an error and not the actually code but OK.
- *
- * @covers \FireflyIII\Http\Controllers\RuleController::testTriggers
- */
- public function testTestTriggers()
- {
- $this->be($this->user());
- $this->call('get', route('rules.test-triggers', [1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::up
- */
- public function testUp()
- {
- $this->be($this->user());
- $this->call('get', route('rules.up', [1]));
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('rules.index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::update
- */
- public function testUpdate()
- {
- $data = [
- 'rule_group_id' => 1,
- 'title' => 'Your first default rule',
- 'trigger' => 'store-journal',
- 'active' => 1,
- 'description' => 'This rule is an example. You can safely delete it.',
- 'rule-trigger' => [
- 1 => 'description_is',
- ],
- 'rule-trigger-value' => [
- 1 => 'something',
- ],
- 'rule-action' => [
- 1 => 'prepend_description',
- ],
- 'rule-action-value' => [
- 1 => 'Bla bla',
- ],
- ];
- $this->session(['rules.edit.url' => 'http://localhost']);
-
- $repository = $this->mock(RuleRepositoryInterface::class);
- $repository->shouldReceive('update');
-
- $this->be($this->user());
- $this->call('post', route('rules.update', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-}
diff --git a/tests/acceptance/Controllers/RuleGroupControllerTest.php b/tests/acceptance/Controllers/RuleGroupControllerTest.php
deleted file mode 100644
index b61a95409e..0000000000
--- a/tests/acceptance/Controllers/RuleGroupControllerTest.php
+++ /dev/null
@@ -1,173 +0,0 @@
-be($this->user());
- $this->call('get', route('rule-groups.create'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('get', route('rule-groups.delete', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::destroy
- */
- public function testDestroy()
- {
- $repository = $this->mock(RuleGroupRepositoryInterface::class);
- $repository->shouldReceive('destroy');
-
- $this->session(['rule-groups.delete.url' => 'http://localhost']);
- $this->be($this->user());
- $this->call('post', route('rule-groups.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertRedirectedToRoute('index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::down
- */
- public function testDown()
- {
- $this->be($this->user());
- $this->call('get', route('rule-groups.down', [1]));
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('rules.index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('get', route('rule-groups.edit', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::execute
- */
- public function testExecute()
- {
- $this->session(['first' => new Carbon('2010-01-01')]);
- $data = [
- 'accounts' => [1],
- 'start_date' => '2010-01-02',
- 'end_date' => '2010-01-02',
- ];
- $this->be($this->user());
- $this->call('post', route('rule-groups.execute', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertRedirectedToRoute('rules.index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::selectTransactions
- */
- public function testSelectTransactions()
- {
- $this->be($this->user());
- $this->call('get', route('rule-groups.select-transactions', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::store
- */
- public function testStore()
- {
- $this->session(['rule-groups.create.url' => 'http://localhost']);
- $data = [
- 'title' => 'A',
- 'description' => '',
- ];
-
- $repository = $this->mock(RuleGroupRepositoryInterface::class);
- $repository->shouldReceive('store')->andReturn(new RuleGroup);
- $repository->shouldReceive('find')->andReturn(new RuleGroup);
-
- $this->be($this->user());
- $this->call('post', route('rule-groups.store', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::up
- */
- public function testUp()
- {
- $this->be($this->user());
- $this->call('get', route('rule-groups.up', [1]));
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('rules.index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::update
- */
- public function testUpdate()
- {
- $data = [
- 'title' => 'C',
- 'description' => 'XX',
- ];
- $this->session(['rule-groups.edit.url' => 'http://localhost']);
-
- $repository = $this->mock(RuleGroupRepositoryInterface::class);
- $repository->shouldReceive('update');
- $repository->shouldReceive('find')->andReturn(new RuleGroup);
-
- $this->be($this->user());
- $this->call('post', route('rule-groups.update', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-}
diff --git a/tests/acceptance/Controllers/SearchControllerTest.php b/tests/acceptance/Controllers/SearchControllerTest.php
deleted file mode 100644
index 68b1b97636..0000000000
--- a/tests/acceptance/Controllers/SearchControllerTest.php
+++ /dev/null
@@ -1,49 +0,0 @@
-mock(SearchInterface::class);
- $search->shouldReceive('setLimit')->once();
- $search->shouldReceive('searchTransactions')->andReturn(new Collection)->withArgs([['test']])->once();
- $search->shouldReceive('searchBudgets')->andReturn(new Collection)->withArgs([['test']])->once();
- $search->shouldReceive('searchTags')->andReturn(new Collection)->withArgs([['test']])->once();
- $search->shouldReceive('searchCategories')->andReturn(new Collection)->withArgs([['test']])->once();
- $search->shouldReceive('searchAccounts')->andReturn(new Collection)->withArgs([['test']])->once();
- $this->be($this->user());
- $this->call('get', route('search.index') . '?q=test');
- $this->assertResponseStatus(200);
- $this->see('');
- }
-}
diff --git a/tests/acceptance/Controllers/TagControllerTest.php b/tests/acceptance/Controllers/TagControllerTest.php
deleted file mode 100644
index 4a7717d528..0000000000
--- a/tests/acceptance/Controllers/TagControllerTest.php
+++ /dev/null
@@ -1,135 +0,0 @@
-be($this->user());
- $this->call('GET', route('tags.create'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TagController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('GET', route('tags.delete', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TagController::destroy
- */
- public function testDestroy()
- {
- $repository = $this->mock(TagRepositoryInterface::class);
- $repository->shouldReceive('destroy');
-
- $this->be($this->user());
- $this->call('post', route('tags.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TagController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('GET', route('tags.edit', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TagController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('GET', route('tags.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TagController::show
- */
- public function testShow()
- {
- $this->be($this->user());
- $this->call('GET', route('tags.show', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TagController::store
- */
- public function testStore()
- {
- $this->session(['tags.create.url' => 'http://localhost']);
- $data = [
- 'tag' => 'Hello new tag' . rand(999, 10000),
- 'tagMode' => 'nothing',
- ];
- $this->be($this->user());
- $this->call('post', route('tags.store'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TagController::update
- */
- public function testUpdate()
- {
- $this->session(['tags.edit.url' => 'http://localhost']);
- $data = [
- 'tag' => 'Hello updated tag' . rand(999, 10000),
- 'tagMode' => 'nothing',
- ];
- $repository = $this->mock(TagRepositoryInterface::class);
- $repository->shouldReceive('update');
- $repository->shouldReceive('find')->andReturn(new Tag);
-
- $this->be($this->user());
- $this->call('post', route('tags.update', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-}
diff --git a/tests/acceptance/Controllers/Transaction/ConvertControllerTest.php b/tests/acceptance/Controllers/Transaction/ConvertControllerTest.php
deleted file mode 100644
index deab21f8d7..0000000000
--- a/tests/acceptance/Controllers/Transaction/ConvertControllerTest.php
+++ /dev/null
@@ -1,121 +0,0 @@
-where('user_id', $this->user()->id)->first();
-
- $this->be($this->user());
- $this->call('get', route('transactions.convert.index', ['transfer', $deposit->id]));
- $this->assertResponseStatus(200);
- $this->see('Convert a deposit into a transfer');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::index
- */
- public function testIndexDepositWithdrawal()
- {
- $deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
- $this->be($this->user());
- $this->call('get', route('transactions.convert.index', ['withdrawal', $deposit->id]));
- $this->assertResponseStatus(200);
- $this->see('Convert a deposit into a withdrawal');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::index
- */
- public function testIndexTransferDeposit()
- {
- $transfer = TransactionJournal::where('transaction_type_id', 3)->where('user_id', $this->user()->id)->first();
- $this->be($this->user());
- $this->call('get', route('transactions.convert.index', ['deposit', $transfer->id]));
- $this->assertResponseStatus(200);
- $this->see('Convert a transfer into a deposit');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::index
- */
- public function testIndexTransferWithdrawal()
- {
- $transfer = TransactionJournal::where('transaction_type_id', 3)->where('user_id', $this->user()->id)->first();
- $this->be($this->user());
- $this->call('get', route('transactions.convert.index', ['withdrawal', $transfer->id]));
- $this->assertResponseStatus(200);
- $this->see('Convert a transfer into a withdrawal');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::index
- */
- public function testIndexWithdrawalDeposit()
- {
- $withdrawal= TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
- $this->be($this->user());
- $this->call('get', route('transactions.convert.index', ['deposit', $withdrawal->id]));
- $this->assertResponseStatus(200);
- $this->see('Convert a withdrawal into a deposit');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::index
- */
- public function testIndexWithdrawalTransfer()
- {
- $withdrawal= TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
- $this->be($this->user());
- $this->call('get', route('transactions.convert.index', ['transfer', $withdrawal->id]));
- $this->assertResponseStatus(200);
- $this->see('Convert a withdrawal into a transfer');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::postIndex
- */
- public function testPostIndex()
- {
- $withdrawal= TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
- // convert a withdrawal to a transfer. Requires the ID of another asset account.
- $data = [
- 'destination_account_asset' => 2,
- ];
- $this->be($this->user());
- $this->call('post', route('transactions.convert.index', ['transfer', $withdrawal->id]), $data);
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('transactions.show', [$withdrawal->id]);
- }
-}
diff --git a/tests/acceptance/Controllers/Transaction/MassControllerTest.php b/tests/acceptance/Controllers/Transaction/MassControllerTest.php
deleted file mode 100644
index e6bf99179e..0000000000
--- a/tests/acceptance/Controllers/Transaction/MassControllerTest.php
+++ /dev/null
@@ -1,115 +0,0 @@
-where('user_id', $this->user()->id)->take(2)->get()->pluck('id')->toArray();
- $this->be($this->user());
- $this->call('get', route('transactions.mass.delete', $withdrawals));
- $this->assertResponseStatus(200);
- $this->see('Delete a number of transactions');
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\MassController::destroy
- */
- public function testDestroy()
- {
- $this->session(['transactions.mass-delete.url' => 'http://localhost']);
- $deposits = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->take(2)->get()->pluck('id')->toArray();
- $data = [
- 'confirm_mass_delete' => $deposits,
- ];
- $this->be($this->user());
- $this->call('post', route('transactions.mass.destroy'), $data);
- $this->assertSessionHas('success');
- $this->assertResponseStatus(302);
-
- // visit them should give 404.
- $this->call('get', route('transactions.show', [$deposits[0]]));
- $this->assertResponseStatus(404);
-
-
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\MassController::edit
- */
- public function testEdit()
- {
- $transfers = TransactionJournal::where('transaction_type_id', 3)->where('user_id', $this->user()->id)->take(2)->get()->pluck('id')->toArray();
- $this->be($this->user());
- $this->call('get', route('transactions.mass.delete', $transfers));
- $this->assertResponseStatus(200);
- $this->see('Edit a number of transactions');
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\MassController::update
- */
- public function testUpdate()
- {
- $deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)
- ->whereNull('deleted_at')
- ->first();
- $this->session(['transactions.mass-edit.url' => 'http://localhost']);
-
- $data = [
- 'journals' => [$deposit->id],
- 'description' => [$deposit->id => 'Updated salary thing'],
- 'amount' => [$deposit->id => 1600],
- 'amount_currency_id_amount_' . $deposit->id => 1,
- 'date' => [$deposit->id => '2014-07-24'],
- 'source_account_name' => [$deposit->id => 'Job'],
- 'destination_account_id' => [$deposit->id => 1],
- 'category' => [$deposit->id => 'Salary'],
- ];
-
- $this->be($this->user());
- $this->call('post', route('transactions.mass.update', [$deposit->id]), $data);
- $this->assertSessionHas('success');
- $this->assertResponseStatus(302);
-
- // visit them should show updated content
- $this->call('get', route('transactions.show', [$deposit->id]));
- $this->assertResponseStatus(200);
- $this->see('Updated salary thing');
- }
-
-}
diff --git a/tests/acceptance/Controllers/Transaction/SingleControllerTest.php b/tests/acceptance/Controllers/Transaction/SingleControllerTest.php
deleted file mode 100644
index 81e67a4e21..0000000000
--- a/tests/acceptance/Controllers/Transaction/SingleControllerTest.php
+++ /dev/null
@@ -1,141 +0,0 @@
-be($this->user());
- $this->call('get', route('transactions.create', ['withdrawal']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\SingleController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('get', route('transactions.delete', [12]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\SingleController::destroy
- */
- public function testDestroy()
- {
- $this->session(['transactions.delete.url' => 'http://localhost']);
- $this->be($this->user());
-
- $repository = $this->mock(JournalRepositoryInterface::class);
- $repository->shouldReceive('first')->once()->andReturn(new TransactionJournal);
- $repository->shouldReceive('delete')->once();
-
- $this->call('post', route('transactions.destroy', [13]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\SingleController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('get', route('transactions.edit', [13]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\SingleController::store
- */
- public function testStore()
- {
- $this->session(['transactions.create.url' => 'http://localhost']);
- $this->be($this->user());
-
- $data = [
- 'what' => 'withdrawal',
- 'amount' => '10',
- 'amount_currency_id_amount' => 1,
- 'source_account_id' => 1,
- 'destination_account_name' => 'Some destination',
- 'date' => '2016-01-01',
- 'description' => 'Test descr',
- ];
- $this->call('post', route('transactions.store', ['withdrawal']), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\SingleController::update
- */
- public function testUpdate()
- {
- $this->session(['transactions.edit.url' => 'http://localhost']);
- $this->be($this->user());
- $data = [
- 'id' => 123,
- 'what' => 'withdrawal',
- 'description' => 'Updated groceries',
- 'source_account_id' => 1,
- 'destination_account_name' => 'PLUS',
- 'amount' => '123',
- 'amount_currency_id_amount' => 1,
- 'budget_id' => 1,
- 'category' => 'Daily groceries',
- 'tags' => '',
- 'date' => '2016-01-01',
- ];
-
- $this->call('post', route('transactions.update', [123]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- $this->call('get', route('transactions.show', [123]));
- $this->assertResponseStatus(200);
- $this->see('Updated groceries');
- // has bread crumb
- $this->see('');
-
- }
-}
diff --git a/tests/acceptance/Controllers/Transaction/SplitControllerTest.php b/tests/acceptance/Controllers/Transaction/SplitControllerTest.php
deleted file mode 100644
index df52e7af6f..0000000000
--- a/tests/acceptance/Controllers/Transaction/SplitControllerTest.php
+++ /dev/null
@@ -1,86 +0,0 @@
-where('user_id', $this->user()->id)->first();
- $this->be($this->user());
- $this->call('get', route('transactions.split.edit', [$deposit->id]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\SplitController::update
- * Implement testUpdate().
- */
- public function testUpdate()
- {
- $this->session(['transactions.edit-split.url' => 'http://localhost']);
- $deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
- $data = [
- 'id' => $deposit->id,
- 'what' => 'deposit',
- 'journal_description' => 'Updated salary',
- 'currency_id' => 1,
- 'journal_destination_account_id' => 1,
- 'journal_amount' => 1591,
- 'date' => '2014-01-24',
- 'tags' => '',
- 'transactions' => [
- [
- 'description' => 'Split #1',
- 'source_account_name' => 'Job',
- 'amount' => 1591,
- 'category' => '',
- ],
- ],
- ];
- $this->be($this->user());
- $this->call('post', route('transactions.split.update', [$deposit->id]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- // journal is updated?
- $this->call('get', route('transactions.show', [$deposit->id]));
- $this->assertResponseStatus(200);
- $this->see('Updated salary');
- // has bread crumb
- $this->see('');
- }
-
-}
diff --git a/tests/acceptance/Controllers/TransactionControllerTest.php b/tests/acceptance/Controllers/TransactionControllerTest.php
deleted file mode 100644
index d5e596fd60..0000000000
--- a/tests/acceptance/Controllers/TransactionControllerTest.php
+++ /dev/null
@@ -1,89 +0,0 @@
-be($this->user());
- $this->call('get', route('transactions.index', ['transfer']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TransactionController::indexAll
- */
- public function testIndexAll()
- {
- $this->be($this->user());
- $this->call('get', route('transactions.index.all', ['transfer']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TransactionController::indexByDate
- */
- public function testIndexByDate()
- {
- $this->be($this->user());
- $this->call('get', route('transactions.index.date', ['transfer', '2016-01-01']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TransactionController::reorder
- */
- public function testReorder()
- {
- $data = [
- 'items' => [],
- ];
- $this->be($this->user());
- $this->call('post', route('transactions.reorder'), $data);
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TransactionController::show
- */
- public function testShow()
- {
- $this->be($this->user());
- $this->call('get', route('transactions.show', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-}
diff --git a/tests/unit/Models/AccountTest.php b/tests/unit/Models/AccountTest.php
deleted file mode 100644
index 6be272929b..0000000000
--- a/tests/unit/Models/AccountTest.php
+++ /dev/null
@@ -1,83 +0,0 @@
- 1,
- 'name' => 'Test account #' . rand(1000, 9999),
- ];
- $account = Account::firstOrCreateEncrypted($data);
-
- $this->assertEquals($account->user_id, $data['user_id']);
- $this->assertEquals($account->name, $data['name']);
- }
-
- /**
- * @covers \FireflyIII\Models\Account::firstOrCreateEncrypted
- */
- public function testEncryptedIban()
- {
- $data = [
- 'user_id' => 1,
- 'iban' => 'NL64RABO0133183395',
- ];
- $account = Account::firstOrCreateEncrypted($data);
-
- $this->assertEquals($account->user_id, $data['user_id']);
- $this->assertEquals($account->name, $data['iban']);
- }
-
- /**
- * @covers \FireflyIII\Models\Account::firstOrCreateEncrypted
- * @expectedException \FireflyIII\Exceptions\FireflyException
- */
- public function testEncryptedNoId()
- {
- $data = [
- 'name' => 'Test account',
- ];
- $account = Account::firstOrCreateEncrypted($data);
- }
-
- /**
- * @covers \FireflyIII\Models\Account::routeBinder
- */
- public function testRouteBinder()
- {
- // not logged in?
- $this->be($this->user());
- $this->call('get', route('accounts.show', [1]));
-
- }
-
- /**
- * One that belongs to another user.
- *
- * @covers \FireflyIII\Models\Account::routeBinder
- */
- public function testRouteBinderError()
- {
- $account = Account::whereUserId(3)->first();
- $this->be($this->user());
- $this->call('get', route('accounts.show', [$account->id]));
- $this->assertResponseStatus(404);
- }
-}
\ No newline at end of file
diff --git a/tests/unit/Models/TransactionTypeTest.php b/tests/unit/Models/TransactionTypeTest.php
deleted file mode 100644
index 51d8a1ea76..0000000000
--- a/tests/unit/Models/TransactionTypeTest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-first();
- $this->assertTrue($transactionType->isDeposit());
- }
-
- /**
- * @covers \FireflyIII\Models\TransactionType::isOpeningBalance
- */
- public function testIsOpeningBalance()
- {
- $transactionType = TransactionType::whereType(TransactionType::OPENING_BALANCE)->first();
- $this->assertTrue($transactionType->isOpeningBalance());
- }
-
- /**
- * @covers \FireflyIII\Models\TransactionType::isTransfer
- */
- public function testIsTransfer()
- {
- $transactionType = TransactionType::whereType(TransactionType::TRANSFER)->first();
- $this->assertTrue($transactionType->isTransfer());
- }
-
- /**
- * @covers \FireflyIII\Models\TransactionType::isWithdrawal
- */
- public function testIsWithdrawal()
- {
- $transactionType = TransactionType::whereType(TransactionType::WITHDRAWAL)->first();
- $this->assertTrue($transactionType->isWithdrawal());
- }
-}