Files
firefly-iii/tests/Feature/Controllers/Transaction/EditControllerTest.php

68 lines
2.1 KiB
PHP
Raw Normal View History

2019-07-20 06:22:37 +02:00
<?php
/**
* EditControllerTest.php
2020-02-16 13:59:55 +01:00
* Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
2019-08-17 12:09:03 +02:00
declare(strict_types=1);
2019-07-20 06:22:37 +02:00
namespace Tests\Feature\Controllers\Transaction;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
2019-08-29 17:53:25 +02:00
use FireflyIII\Repositories\User\UserRepositoryInterface;
2019-07-20 06:22:37 +02:00
use Log;
use Tests\TestCase;
/**
* Class EditControllerTest
2019-08-17 10:48:28 +02:00
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
2019-07-20 06:22:37 +02:00
*/
class EditControllerTest extends TestCase
{
/**
*
*/
public function setUp(): void
{
2020-07-30 20:49:40 +02:00
self::markTestIncomplete('Incomplete for refactor.');
return;
parent::setUp();
2019-07-20 06:22:37 +02:00
Log::info(sprintf('Now in %s.', get_class($this)));
}
public function testEdit(): void
{
$group = $this->getRandomWithdrawalGroup();
$account = $this->getRandomAsset();
$accountRepos = $this->mock(AccountRepositoryInterface::class);
2019-08-29 17:53:25 +02:00
$userRepos = $this->mock(UserRepositoryInterface::class);
2019-07-20 06:22:37 +02:00
2019-08-29 17:53:25 +02:00
$this->mockDefaultSession();
$userRepos->shouldReceive('hasRole')->atLeast()->once()->andReturn(true);
2019-07-20 06:22:37 +02:00
$accountRepos->shouldReceive('getCashAccount')->atLeast()->once()->andReturn($account);
$this->be($this->user());
$response = $this->get(route('transactions.edit', [$group->id]));
$response->assertStatus(200);
}
2019-08-17 12:09:03 +02:00
}