Some code cleanup.

This commit is contained in:
James Cole
2017-07-08 06:28:44 +02:00
parent de9728895e
commit 5ef2067836
53 changed files with 597 additions and 449 deletions

View File

@@ -274,22 +274,6 @@ class RuleControllerTest extends TestCase
$response->assertSessionHas('success');
}
/**
* This actually hits an error and not the actually code but OK.
*
* @covers \FireflyIII\Http\Controllers\RuleController::testTriggers
* @covers \FireflyIII\Http\Controllers\RuleController::getValidTriggerList
*/
public function testTestTriggersError()
{
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$this->be($this->user());
$uri = route('rules.test-triggers');
$response = $this->get($uri);
$response->assertStatus(200);
}
/**
*
* @covers \FireflyIII\Http\Controllers\RuleController::testTriggers
@@ -314,7 +298,24 @@ class RuleControllerTest extends TestCase
$matcher->shouldReceive('findMatchingTransactions')->andReturn(new Collection);
$this->be($this->user());
$uri = route('rules.test-triggers') . '?' . http_build_query($data);
$uri = route('rules.test-triggers') . '?' . http_build_query($data);
$response = $this->get($uri);
$response->assertStatus(200);
}
/**
* This actually hits an error and not the actually code but OK.
*
* @covers \FireflyIII\Http\Controllers\RuleController::testTriggers
* @covers \FireflyIII\Http\Controllers\RuleController::getValidTriggerList
*/
public function testTestTriggersError()
{
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$this->be($this->user());
$uri = route('rules.test-triggers');
$response = $this->get($uri);
$response->assertStatus(200);
}
@@ -330,7 +331,7 @@ class RuleControllerTest extends TestCase
'rule-trigger-value' => ['Bla bla'],
'rule-trigger-stop' => ['1'],
];
$set = factory(Transaction::class, 10)->make();
$set = factory(Transaction::class, 10)->make();
// mock stuff
$matcher = $this->mock(TransactionMatcher::class);
@@ -343,7 +344,7 @@ class RuleControllerTest extends TestCase
$matcher->shouldReceive('findMatchingTransactions')->andReturn($set);
$this->be($this->user());
$uri = route('rules.test-triggers') . '?' . http_build_query($data);
$uri = route('rules.test-triggers') . '?' . http_build_query($data);
$response = $this->get($uri);
$response->assertStatus(200);
}