Cleanup [skip ci]

This commit is contained in:
James Cole
2015-05-14 09:51:54 +02:00
parent d543c033a3
commit 1dcf7407e6
26 changed files with 84 additions and 47 deletions

View File

@@ -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',

View File

@@ -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');

View File

@@ -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];

View File

@@ -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();
}

View File

@@ -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:

View File

@@ -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);

View File

@@ -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

View File

@@ -380,7 +380,7 @@ class TagRepositoryTest extends TestCase
*/
public function testUpdate()
{
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
$data = [