mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-24 04:41:01 +00:00
Fix rule validation issues.
This commit is contained in:
@@ -243,13 +243,12 @@ class RuleControllerTest extends TestCase
|
||||
public function testStore()
|
||||
{
|
||||
// mock stuff
|
||||
$repository = $this->mock(RuleRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$ruleGroupRepos = $this->mock(RuleGroupRepositoryInterface::class);
|
||||
$repository = $this->mock(RuleRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$ruleGroupRepos->shouldReceive('find')->andReturn(new RuleGroup)->once();
|
||||
$repository->shouldReceive('store')->andReturn(new Rule);
|
||||
$repository->shouldReceive('find')->withArgs([0])->andReturn(new Rule)->once();
|
||||
|
||||
$this->session(['rules.create.uri' => 'http://localhost']);
|
||||
$data = [
|
||||
@@ -375,12 +374,11 @@ class RuleControllerTest extends TestCase
|
||||
public function testUpdate()
|
||||
{
|
||||
// mock stuff
|
||||
$repository = $this->mock(RuleRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$ruleGroupRepos = $this->mock(RuleGroupRepositoryInterface::class);
|
||||
|
||||
$repository = $this->mock(RuleRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$rule = Rule::find(1);
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$ruleGroupRepos->shouldReceive('find')->andReturn(new RuleGroup)->once();
|
||||
$repository->shouldReceive('find')->withArgs([1])->andReturn($rule)->once();
|
||||
$repository->shouldReceive('update');
|
||||
|
||||
$data = [
|
||||
|
||||
Reference in New Issue
Block a user