mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Cleanup [skip ci]
This commit is contained in:
@@ -39,7 +39,7 @@ class AuthControllerTest extends TestCase
|
||||
public function testPostRegister()
|
||||
{
|
||||
|
||||
$data = [
|
||||
$data = [
|
||||
'email' => 'test@example.com',
|
||||
'password' => 'onetwothree',
|
||||
'password_confirmation' => 'onetwothree',
|
||||
@@ -53,7 +53,7 @@ class AuthControllerTest extends TestCase
|
||||
public function testPostRegisterFails()
|
||||
{
|
||||
|
||||
$data = [
|
||||
$data = [
|
||||
'email' => 'test@example.com',
|
||||
'password' => 'onetwothree',
|
||||
'password_confirmation' => 'onetwofour',
|
||||
|
@@ -115,29 +115,6 @@ class TagControllerTest extends TestCase
|
||||
$this->assertResponseOk();
|
||||
}
|
||||
|
||||
public function testMultipleDeposits()
|
||||
{
|
||||
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
$type = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
|
||||
for ($i = 0; $i < 3; $i++) {
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$journal->transaction_type_id = $type->id;
|
||||
$journal->save();
|
||||
$tag->transactionJournals()->save($journal);
|
||||
}
|
||||
|
||||
|
||||
$tag->tagMode = 'nothing';
|
||||
$tag->save();
|
||||
$this->be($tag->user);
|
||||
|
||||
$this->call('GET', '/tags/edit/' . $tag->id);
|
||||
$this->assertResponseOk();
|
||||
}
|
||||
|
||||
|
||||
public function testHideTagHelp()
|
||||
{
|
||||
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||
@@ -156,6 +133,28 @@ class TagControllerTest extends TestCase
|
||||
$this->assertResponseOk();
|
||||
}
|
||||
|
||||
public function testMultipleDeposits()
|
||||
{
|
||||
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
$type = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
|
||||
for ($i = 0; $i < 3; $i++) {
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$journal->transaction_type_id = $type->id;
|
||||
$journal->save();
|
||||
$tag->transactionJournals()->save($journal);
|
||||
}
|
||||
|
||||
|
||||
$tag->tagMode = 'nothing';
|
||||
$tag->save();
|
||||
$this->be($tag->user);
|
||||
|
||||
$this->call('GET', '/tags/edit/' . $tag->id);
|
||||
$this->assertResponseOk();
|
||||
}
|
||||
|
||||
public function testShow()
|
||||
{
|
||||
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||
|
@@ -173,7 +173,7 @@ FactoryMuffin::define(
|
||||
'FireflyIII\Models\AccountType',
|
||||
[
|
||||
'type' => function () {
|
||||
$types = ['Expense account', 'Revenue account', 'Asset account','Cash account'];
|
||||
$types = ['Expense account', 'Revenue account', 'Asset account', 'Cash account'];
|
||||
$count = DB::table('account_types')->count();
|
||||
if ($count < 4) {
|
||||
return $types[$count];
|
||||
|
@@ -49,7 +49,7 @@ class ConnectJournalToPiggyBankTest extends TestCase
|
||||
$user = FactoryMuffin::create('FireflyIII\User');
|
||||
$this->be($user);
|
||||
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
/** @var \FireflyIII\Models\PiggyBank $piggyBank */
|
||||
$piggyBank = FactoryMuffin::create('FireflyIII\Models\PiggyBank');
|
||||
$account1 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||
@@ -64,7 +64,7 @@ class ConnectJournalToPiggyBankTest extends TestCase
|
||||
// because the event handler responds to this piggy bank, we must remove
|
||||
// the piggy bank repetition:
|
||||
/** @var \FireflyIII\Models\PiggyBankRepetition $rep */
|
||||
foreach($piggyBank->piggyBankRepetitions()->get() as $rep) {
|
||||
foreach ($piggyBank->piggyBankRepetitions()->get() as $rep) {
|
||||
$rep->forceDelete();
|
||||
}
|
||||
|
||||
|
@@ -130,8 +130,8 @@ class ReportHelperTest extends TestCase
|
||||
|
||||
public function testYearBalanceReport()
|
||||
{
|
||||
$date = new Carbon('2015-01-01');
|
||||
$user = FactoryMuffin::create('FireflyIII\User');
|
||||
$date = new Carbon('2015-01-01');
|
||||
$user = FactoryMuffin::create('FireflyIII\User');
|
||||
$setShared = [];
|
||||
$setNormal = [];
|
||||
|
||||
@@ -171,7 +171,7 @@ class ReportHelperTest extends TestCase
|
||||
$this->be($user);
|
||||
|
||||
$result = $this->object->yearBalanceReport($date, false);
|
||||
foreach($result as $entry) {
|
||||
foreach ($result as $entry) {
|
||||
// everything is hidden:
|
||||
$this->assertTrue($entry['hide']);
|
||||
// nothing is shared:
|
||||
@@ -182,8 +182,8 @@ class ReportHelperTest extends TestCase
|
||||
|
||||
public function testYearBalanceReportWithShared()
|
||||
{
|
||||
$date = new Carbon('2015-01-01');
|
||||
$user = FactoryMuffin::create('FireflyIII\User');
|
||||
$date = new Carbon('2015-01-01');
|
||||
$user = FactoryMuffin::create('FireflyIII\User');
|
||||
$setShared = [];
|
||||
$setNormal = [];
|
||||
|
||||
@@ -223,7 +223,7 @@ class ReportHelperTest extends TestCase
|
||||
$this->be($user);
|
||||
|
||||
$result = $this->object->yearBalanceReport($date, true);
|
||||
foreach($result as $entry) {
|
||||
foreach ($result as $entry) {
|
||||
// everything is hidden:
|
||||
$this->assertTrue($entry['hide']);
|
||||
// nothing is shared:
|
||||
|
@@ -363,7 +363,7 @@ class BudgetRepositoryTest extends TestCase
|
||||
*/
|
||||
public function testUpdateLimitAmountExisting()
|
||||
{
|
||||
$budgetLimit= FactoryMuffin::create('FireflyIII\Models\BudgetLimit');
|
||||
$budgetLimit = FactoryMuffin::create('FireflyIII\Models\BudgetLimit');
|
||||
|
||||
$result = $this->object->updateLimitAmount($budgetLimit->budget, $budgetLimit->startdate, 100);
|
||||
|
||||
@@ -376,7 +376,7 @@ class BudgetRepositoryTest extends TestCase
|
||||
*/
|
||||
public function testUpdateLimitAmountZero()
|
||||
{
|
||||
$budgetLimit= FactoryMuffin::create('FireflyIII\Models\BudgetLimit');
|
||||
$budgetLimit = FactoryMuffin::create('FireflyIII\Models\BudgetLimit');
|
||||
|
||||
$result = $this->object->updateLimitAmount($budgetLimit->budget, $budgetLimit->startdate, 0);
|
||||
|
||||
|
@@ -478,6 +478,7 @@ class JournalRepositoryTest extends TestCase
|
||||
$this->assertEquals($result->description, $data['description']);
|
||||
$this->assertEquals($result->amount, 50);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Repositories\Journal\JournalRepository::update
|
||||
* @covers FireflyIII\Repositories\Journal\JournalRepository::updateTags
|
||||
|
@@ -380,7 +380,7 @@ class TagRepositoryTest extends TestCase
|
||||
*/
|
||||
public function testUpdate()
|
||||
{
|
||||
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||
|
||||
|
||||
$data = [
|
||||
|
Reference in New Issue
Block a user