mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 14:48:11 +00:00
Code cleanup.
This commit is contained in:
@@ -18,12 +18,10 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Feature\Controllers\Chart;
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
||||
@@ -42,14 +40,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class BudgetControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Chart
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class BudgetControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::budget
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::__construct
|
||||
@@ -66,7 +62,6 @@ class BudgetControllerTest extends TestCase
|
||||
$repository->shouldReceive('spentInPeriod')->andReturn('-100');
|
||||
$generator->shouldReceive('singleSet')->andReturn([])->once();
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$response = $this->get(route('chart.budget.budget', [1]));
|
||||
@@ -84,7 +79,6 @@ class BudgetControllerTest extends TestCase
|
||||
$repository = $this->mock(BudgetRepositoryInterface::class);
|
||||
$generator = $this->mock(GeneratorInterface::class);
|
||||
|
||||
|
||||
$repository->shouldReceive('spentInPeriod')->andReturn('-100');
|
||||
$generator->shouldReceive('singleSet')->once()->andReturn([]);
|
||||
|
||||
@@ -214,7 +208,6 @@ class BudgetControllerTest extends TestCase
|
||||
$budgetLimit->budget_id = $budget->id;
|
||||
$transaction = factory(Transaction::class)->make();
|
||||
|
||||
|
||||
$repository->shouldReceive('getActiveBudgets')->andReturn(new Collection([$budget]))->once();
|
||||
$repository->shouldReceive('getBudgetLimits')->once()->andReturn(new Collection([$budgetLimit]));
|
||||
$repository->shouldReceive('spentInPeriod')->andReturn('-100');
|
||||
@@ -254,7 +247,6 @@ class BudgetControllerTest extends TestCase
|
||||
$two->budget_id = $budget->id;
|
||||
$transaction = factory(Transaction::class)->make();
|
||||
|
||||
|
||||
$repository->shouldReceive('getActiveBudgets')->andReturn(new Collection([$budget]))->once();
|
||||
$repository->shouldReceive('getBudgetLimits')->once()->andReturn(new Collection([$one, $two]));
|
||||
$repository->shouldReceive('spentInPeriod')->andReturn('-100');
|
||||
@@ -290,7 +282,6 @@ class BudgetControllerTest extends TestCase
|
||||
$budget = factory(Budget::class)->make();
|
||||
$transaction = factory(Transaction::class)->make();
|
||||
|
||||
|
||||
$repository->shouldReceive('getActiveBudgets')->andReturn(new Collection([$budget]));
|
||||
$repository->shouldReceive('getBudgetLimits')->once()->andReturn(new Collection);
|
||||
$repository->shouldReceive('spentInPeriod')->andReturn('-100');
|
||||
@@ -325,7 +316,6 @@ class BudgetControllerTest extends TestCase
|
||||
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));
|
||||
$generator->shouldReceive('multiSet')->once()->andReturn([]);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('chart.budget.period', [1, '1', '20120101', '20120131']));
|
||||
$response->assertStatus(200);
|
||||
|
||||
Reference in New Issue
Block a user