mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Code cleanup.
This commit is contained in:
@@ -18,10 +18,8 @@
|
||||
* 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;
|
||||
|
||||
use Illuminate\Contracts\Console\Kernel;
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -42,7 +41,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class AccountControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -79,7 +77,6 @@ class AccountControllerTest extends TestCase
|
||||
$repository->shouldReceive('getAccountsByType')->withArgs([[AccountType::ASSET]])->andReturn(new Collection);
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$account = $this->user()->accounts()->where('account_type_id', 3)->whereNull('deleted_at')->first();
|
||||
$response = $this->get(route('accounts.delete', [$account->id]));
|
||||
@@ -191,7 +188,6 @@ class AccountControllerTest extends TestCase
|
||||
$collector->shouldReceive('getJournals')->andReturn(new Collection([$transaction]));
|
||||
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([$transaction], 0, 10));
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$response = $this->get(route('accounts.show', [1]));
|
||||
@@ -222,7 +218,6 @@ class AccountControllerTest extends TestCase
|
||||
|
||||
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([$transaction], 0, 10));
|
||||
|
||||
|
||||
$tasker = $this->mock(AccountTaskerInterface::class);
|
||||
$tasker->shouldReceive('amountOutInPeriod')->withAnyArgs()->andReturn('-1');
|
||||
$tasker->shouldReceive('amountInInPeriod')->withAnyArgs()->andReturn('1');
|
||||
|
||||
@@ -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\Admin;
|
||||
|
||||
|
||||
use FireflyConfig;
|
||||
use FireflyIII\Models\Configuration;
|
||||
use Tests\TestCase;
|
||||
@@ -31,14 +29,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class ConfigurationControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Admin
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class ConfigurationControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\ConfigurationController::index
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\ConfigurationController::__construct
|
||||
@@ -80,5 +76,4 @@ class ConfigurationControllerTest extends TestCase
|
||||
$response->assertSessionHas('success');
|
||||
$response->assertStatus(302);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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\Admin;
|
||||
@@ -28,14 +27,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class HomeControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Admin
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class HomeControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Admin\HomeController::index
|
||||
*/
|
||||
@@ -47,5 +44,4 @@ class HomeControllerTest extends TestCase
|
||||
// has bread crumb
|
||||
$response->assertSee('<ol class="breadcrumb">');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,10 +18,8 @@
|
||||
* 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\Admin;
|
||||
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
@@ -31,7 +29,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class UserControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Admin
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -111,6 +108,4 @@ class UserControllerTest extends TestCase
|
||||
$response->assertStatus(302);
|
||||
$response->assertSessionHas('success');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
@@ -32,7 +30,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class AttachmentControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -103,7 +100,6 @@ class AttachmentControllerTest extends TestCase
|
||||
$repository->shouldReceive('exists')->once()->andReturn(false);
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('attachments.download', [1]));
|
||||
$response->assertStatus(500);
|
||||
@@ -159,6 +155,4 @@ class AttachmentControllerTest extends TestCase
|
||||
$response->assertStatus(302);
|
||||
$response->assertSessionHas('success');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,19 +18,16 @@
|
||||
* 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\Auth;
|
||||
|
||||
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class ForgotPasswordControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Auth
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
|
||||
@@ -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\Auth;
|
||||
|
||||
|
||||
use FireflyIII\Models\Preference;
|
||||
use PragmaRX\Google2FA\Contracts\Google2FA;
|
||||
use Preferences;
|
||||
@@ -32,7 +30,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class TwoFactorControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Auth
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -51,7 +48,6 @@ class TwoFactorControllerTest extends TestCase
|
||||
$secretPreference = new Preference;
|
||||
$secretPreference->data = 'BlablaSeecret';
|
||||
|
||||
|
||||
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($truePref)->twice();
|
||||
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn($secretPreference)->once();
|
||||
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn($secretPreference)->once();
|
||||
@@ -130,5 +126,4 @@ class TwoFactorControllerTest extends TestCase
|
||||
$response = $this->post(route('two-factor.post'), $data);
|
||||
$response->assertStatus(302);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
||||
use FireflyIII\Models\Bill;
|
||||
@@ -37,7 +35,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class BillControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -252,7 +249,5 @@ class BillControllerTest extends TestCase
|
||||
$response = $this->post(route('bills.update', [1]), $data);
|
||||
$response->assertStatus(302);
|
||||
$response->assertSessionHas('success');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -38,7 +37,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class BudgetControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -184,7 +182,6 @@ class BudgetControllerTest extends TestCase
|
||||
$repository->shouldReceive('collectBudgetInformation')->andReturn($budgetInfo);
|
||||
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$response = $this->get(route('budgets.index'));
|
||||
@@ -231,7 +228,6 @@ class BudgetControllerTest extends TestCase
|
||||
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));
|
||||
$repository->shouldReceive('collectBudgetInformation')->andReturn($budgetInfo);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$response = $this->get(route('budgets.index', ['2017-01-01']));
|
||||
@@ -278,7 +274,6 @@ class BudgetControllerTest extends TestCase
|
||||
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));
|
||||
$repository->shouldReceive('collectBudgetInformation')->andReturn($budgetInfo);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$response = $this->get(route('budgets.index', ['Hello-there']));
|
||||
@@ -455,7 +450,6 @@ class BudgetControllerTest extends TestCase
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\BudgetController::showByBudgetLimit
|
||||
* @expectedExceptionMessage This budget limit is not part of
|
||||
*
|
||||
*/
|
||||
public function testShowByBadBudgetLimit()
|
||||
{
|
||||
@@ -484,7 +478,6 @@ class BudgetControllerTest extends TestCase
|
||||
$accountRepository = $this->mock(AccountRepositoryInterface::class);
|
||||
$accountRepository->shouldReceive('getAccountsByType')->andReturn(new Collection);
|
||||
|
||||
|
||||
// mock budget repository
|
||||
$budgetRepository = $this->mock(BudgetRepositoryInterface::class);
|
||||
$budgetRepository->shouldReceive('spentInPeriod')->andReturn('1');
|
||||
@@ -500,7 +493,6 @@ class BudgetControllerTest extends TestCase
|
||||
$collector->shouldReceive('withBudgetInformation')->andReturnSelf();
|
||||
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$response = $this->get(route('budgets.show.limit', [1, 1]));
|
||||
@@ -575,5 +567,4 @@ class BudgetControllerTest extends TestCase
|
||||
$response = $this->get(route('budgets.income', ['2017-01-01', '2017-01-31']));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -40,7 +39,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class CategoryControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -89,7 +87,6 @@ class CategoryControllerTest extends TestCase
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
|
||||
$repository->shouldReceive('destroy')->andReturn(true);
|
||||
|
||||
$this->session(['categories.delete.uri' => 'http://localhost']);
|
||||
@@ -360,7 +357,6 @@ class CategoryControllerTest extends TestCase
|
||||
$repository->shouldReceive('spentInPeriod')->andReturn('-1');
|
||||
$repository->shouldReceive('earnedInPeriod')->andReturn('1');
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$response = $this->get(route('categories.show', [1, '2015-01-01']));
|
||||
@@ -456,6 +452,4 @@ class CategoryControllerTest extends TestCase
|
||||
$response->assertStatus(302);
|
||||
$response->assertSessionHas('success');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -43,14 +41,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class AccountControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Chart
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class AccountControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::all
|
||||
*/
|
||||
@@ -85,7 +81,6 @@ class AccountControllerTest extends TestCase
|
||||
$generator->shouldReceive('singleSet')->andReturn([]);
|
||||
Steam::shouldReceive('balancesByAccounts')->twice()->andReturn([]);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$response = $this->get(route('chart.account.expense'));
|
||||
@@ -114,7 +109,6 @@ class AccountControllerTest extends TestCase
|
||||
$generator->shouldReceive('pieChart')->andReturn([]);
|
||||
$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$response = $this->get(route('chart.account.expense-budget', [1, '20120101', '20120131']));
|
||||
@@ -145,7 +139,6 @@ class AccountControllerTest extends TestCase
|
||||
$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection);
|
||||
$accountRepos->shouldReceive('oldestJournalDate')->andReturn(Carbon::createFromTimestamp(time())->startOfMonth());
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$response = $this->get(route('chart.account.expense-budget-all', [1]));
|
||||
@@ -374,5 +367,4 @@ class AccountControllerTest extends TestCase
|
||||
$response = $this->get(route('chart.account.single', [1]));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
||||
use FireflyIII\Models\Transaction;
|
||||
@@ -34,7 +32,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class BillControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Chart
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -82,5 +79,4 @@ class BillControllerTest extends TestCase
|
||||
$response = $this->get(route('chart.bill.single', [1]));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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\Chart\MetaPieChartInterface;
|
||||
@@ -41,7 +39,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class BudgetReportControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Chart
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -117,7 +114,6 @@ class BudgetReportControllerTest extends TestCase
|
||||
|
||||
$budgetRepos->shouldReceive('getAllBudgetLimits')->andReturn(new Collection([$one, $two]))->once();
|
||||
|
||||
|
||||
$collector->shouldReceive('setAccounts')->andReturnSelf();
|
||||
$collector->shouldReceive('setRange')->andReturnSelf();
|
||||
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL, TransactionType::TRANSFER]])->andReturnSelf();
|
||||
@@ -134,5 +130,4 @@ class BudgetReportControllerTest extends TestCase
|
||||
$response = $this->get(route('chart.budget.main', ['1', '1', '20120101', '20120131', 0]));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Models\Account;
|
||||
@@ -37,14 +35,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class CategoryControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Chart
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class CategoryControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryController::all
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryController::__construct
|
||||
@@ -64,7 +60,6 @@ class CategoryControllerTest extends TestCase
|
||||
$accountRepos->shouldReceive('getAccountsByType')->withArgs([[AccountType::DEFAULT, AccountType::ASSET]])->andReturn(new Collection)->once();
|
||||
$generator->shouldReceive('multiSet')->once()->andReturn([]);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$response = $this->get(route('chart.category.all', [1]));
|
||||
@@ -109,7 +104,6 @@ class CategoryControllerTest extends TestCase
|
||||
$repository->shouldReceive('periodIncome')->andReturn([])->once();
|
||||
$generator->shouldReceive('multiSet')->andReturn([])->once();
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('chart.category.period', [1, '1', '20120101', '20120131']));
|
||||
$response->assertStatus(200);
|
||||
@@ -156,5 +150,4 @@ class CategoryControllerTest extends TestCase
|
||||
$response = $this->get(route('chart.category.specific', ['1', '2012-01-01']));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Helpers\Chart\MetaPieChartInterface;
|
||||
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
||||
@@ -38,14 +36,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class CategoryReportControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Chart
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class CategoryReportControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::accountExpense
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::__construct
|
||||
@@ -160,5 +156,4 @@ class CategoryReportControllerTest extends TestCase
|
||||
$response = $this->get(route('chart.category.main', ['1', '1', '20120101', '20120131']));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Models\PiggyBankEvent;
|
||||
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
||||
@@ -33,7 +31,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class PiggyBankControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Chart
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -57,6 +54,4 @@ class PiggyBankControllerTest extends TestCase
|
||||
$response = $this->get(route('chart.piggy-bank.history', [1]));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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 FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Repositories\Account\AccountTaskerInterface;
|
||||
use Steam;
|
||||
@@ -32,14 +30,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class ReportControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Chart
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class ReportControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ReportController::netWorth
|
||||
* @covers \FireflyIII\Http\Controllers\Chart\ReportController::arraySum
|
||||
@@ -96,5 +92,4 @@ class ReportControllerTest extends TestCase
|
||||
$response = $this->get(route('chart.report.sum', [1, '20120101', '20120131']));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Helpers\Chart\MetaPieChartInterface;
|
||||
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
||||
@@ -40,7 +38,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class TagReportControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Chart
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -88,7 +85,6 @@ class TagReportControllerTest extends TestCase
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('chart.tag.account-income', ['1', 'housing', '20120101', '20120131', 0]));
|
||||
$response->assertStatus(200);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,16 +140,13 @@ class TagReportControllerTest extends TestCase
|
||||
$generator = $this->mock(GeneratorInterface::class);
|
||||
$collector = $this->mock(JournalCollectorInterface::class);
|
||||
$set = new Collection;
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
|
||||
|
||||
for ($i = 0; $i < 10; ++$i) {
|
||||
$transaction = factory(Transaction::class)->make();
|
||||
$tag = factory(Tag::class)->make();
|
||||
$transaction->transactionJournal->tags()->save($tag);
|
||||
$set->push($transaction);
|
||||
}
|
||||
|
||||
|
||||
$collector->shouldReceive('setAccounts')->andReturnSelf();
|
||||
$collector->shouldReceive('setRange')->andReturnSelf();
|
||||
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL, TransactionType::TRANSFER]])->andReturnSelf();
|
||||
@@ -213,6 +206,4 @@ class TagReportControllerTest extends TestCase
|
||||
$response = $this->get(route('chart.tag.tag-income', ['1', 'housing', '20120101', '20120131', 0]));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -34,14 +33,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class CurrencyControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class CurrencyControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\CurrencyController::create
|
||||
*/
|
||||
@@ -73,7 +70,6 @@ class CurrencyControllerTest extends TestCase
|
||||
$repository->shouldReceive('canDeleteCurrency')->andReturn(false);
|
||||
$userRepos->shouldReceive('hasRole')->once()->andReturn(true);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('currencies.delete', [2]));
|
||||
$response->assertStatus(302);
|
||||
@@ -95,7 +91,6 @@ class CurrencyControllerTest extends TestCase
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$userRepos->shouldReceive('hasRole')->once()->andReturn(true);
|
||||
|
||||
|
||||
$this->session(['currencies.delete.uri' => 'http://localhost']);
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('currencies.destroy', [1]));
|
||||
@@ -174,7 +169,6 @@ class CurrencyControllerTest extends TestCase
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$userRepos->shouldReceive('hasRole')->once()->andReturn(true);
|
||||
|
||||
|
||||
$this->session(['currencies.delete.uri' => 'http://localhost']);
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('currencies.destroy', [1]));
|
||||
@@ -328,5 +322,4 @@ class CurrencyControllerTest extends TestCase
|
||||
$response->assertStatus(302);
|
||||
$response->assertSessionHas('success');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -37,14 +36,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class ExportControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class ExportControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\ExportController::download
|
||||
*/
|
||||
@@ -134,7 +131,6 @@ class ExportControllerTest extends TestCase
|
||||
['first' => new Carbon('2014-01-01')]
|
||||
);
|
||||
|
||||
|
||||
$data = [
|
||||
'export_start_range' => '2015-01-01',
|
||||
'export_end_range' => '2015-01-21',
|
||||
@@ -167,5 +163,4 @@ class ExportControllerTest extends TestCase
|
||||
$response->assertStatus(200);
|
||||
$response->assertSee('ok');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -30,14 +29,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class HelpControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class HelpControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\HelpController::show
|
||||
* @covers \FireflyIII\Http\Controllers\HelpController::getHelpText
|
||||
@@ -65,7 +62,7 @@ class HelpControllerTest extends TestCase
|
||||
{
|
||||
// force pref in dutch for test
|
||||
Preference::where('user_id', $this->user()->id)->where('name', 'language')->delete();
|
||||
Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'nl_NL',]);
|
||||
Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'nl_NL']);
|
||||
|
||||
$help = $this->mock(HelpInterface::class);
|
||||
$help->shouldReceive('hasRoute')->withArgs(['index'])->andReturn(true)->once();
|
||||
@@ -83,7 +80,7 @@ class HelpControllerTest extends TestCase
|
||||
|
||||
// put English back:
|
||||
Preference::where('user_id', $this->user()->id)->where('name', 'language')->delete();
|
||||
Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'en_US',]);
|
||||
Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'en_US']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,7 +91,7 @@ class HelpControllerTest extends TestCase
|
||||
{
|
||||
// force pref in dutch for test
|
||||
Preference::where('user_id', $this->user()->id)->where('name', 'language')->delete();
|
||||
Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'nl_NL',]);
|
||||
Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'nl_NL']);
|
||||
|
||||
$help = $this->mock(HelpInterface::class);
|
||||
$help->shouldReceive('hasRoute')->withArgs(['index'])->andReturn(true)->once();
|
||||
@@ -112,7 +109,7 @@ class HelpControllerTest extends TestCase
|
||||
|
||||
// put English back:
|
||||
Preference::where('user_id', $this->user()->id)->where('name', 'language')->delete();
|
||||
Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'en_US',]);
|
||||
Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'en_US']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,5 +143,4 @@ class HelpControllerTest extends TestCase
|
||||
$response->assertStatus(200);
|
||||
$response->assertSee('There is no help for this route.');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -36,7 +35,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class HomeControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -53,7 +51,6 @@ class HomeControllerTest extends TestCase
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
|
||||
$args = [
|
||||
@@ -76,7 +73,6 @@ class HomeControllerTest extends TestCase
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
|
||||
$args = [
|
||||
@@ -191,5 +187,4 @@ class HomeControllerTest extends TestCase
|
||||
$response->assertSessionHas('warning');
|
||||
$response->assertSessionHas('error');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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\Import;
|
||||
@@ -33,7 +32,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class FileControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Import
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -54,7 +52,6 @@ class FileControllerTest extends TestCase
|
||||
$configurator->shouldReceive('getNextView')->once()->andReturn('import.csv.initial');
|
||||
$configurator->shouldReceive('getNextData')->andReturn(['specifics' => [], 'delimiters' => [], 'accounts' => []])->once();
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('import.file.configure', ['configure']));
|
||||
$response->assertStatus(200);
|
||||
@@ -89,7 +86,6 @@ class FileControllerTest extends TestCase
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Import\FileController::initialize
|
||||
*/
|
||||
@@ -156,7 +152,6 @@ class FileControllerTest extends TestCase
|
||||
$configurator->shouldReceive('configureJob')->once()->andReturn(false);
|
||||
$configurator->shouldReceive('getWarningMessage')->once()->andReturn('');
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('import.file.process-configuration', ['running']));
|
||||
$response->assertStatus(302);
|
||||
@@ -172,7 +167,6 @@ class FileControllerTest extends TestCase
|
||||
$configurator->shouldReceive('setJob')->once();
|
||||
$configurator->shouldReceive('isJobConfigured')->once()->andReturn(true);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('import.file.process-configuration', ['running']));
|
||||
$response->assertStatus(302);
|
||||
@@ -188,7 +182,6 @@ class FileControllerTest extends TestCase
|
||||
$importer->shouldReceive('setJob')->once();
|
||||
$importer->shouldReceive('run')->once()->andReturn(true);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('import.file.start', ['running']));
|
||||
$response->assertStatus(200);
|
||||
@@ -204,7 +197,6 @@ class FileControllerTest extends TestCase
|
||||
$importer->shouldReceive('setJob')->once();
|
||||
$importer->shouldReceive('run')->once()->andReturn(false);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('import.file.start', ['running']));
|
||||
$response->assertStatus(500);
|
||||
@@ -230,5 +222,4 @@ class FileControllerTest extends TestCase
|
||||
$response->assertStatus(302);
|
||||
$response->assertRedirect(route('import.file.configure', ['new']));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -28,14 +27,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class ImportControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class ImportControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\ImportController::index
|
||||
*/
|
||||
@@ -46,6 +43,4 @@ class ImportControllerTest extends TestCase
|
||||
$response->assertStatus(200);
|
||||
$response->assertSee('<ol class="breadcrumb">');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -34,7 +33,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class JavascriptControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -83,12 +81,9 @@ class JavascriptControllerTest extends TestCase
|
||||
*/
|
||||
public function testVariables(string $range)
|
||||
{
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$response = $this->get(route('javascript.variables'));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Json;
|
||||
|
||||
|
||||
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
@@ -35,13 +33,9 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class AutoCompleteControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Json
|
||||
*/
|
||||
class AutoCompleteControllerTest extends TestCase
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Json\AutoCompleteController::allAccounts
|
||||
*/
|
||||
@@ -131,5 +125,4 @@ class AutoCompleteControllerTest extends TestCase
|
||||
$response->assertStatus(200);
|
||||
$response->assertExactJson([]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Json;
|
||||
|
||||
|
||||
use FireflyIII\Models\CurrencyExchangeRate;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use Tests\TestCase;
|
||||
@@ -31,14 +29,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class ExchangeControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class ExchangeControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Json\ExchangeController::getRate
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -37,7 +36,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class JsonControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -93,7 +91,6 @@ class JsonControllerTest extends TestCase
|
||||
$response->assertExactJson([$category->name]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\JsonController::tags
|
||||
*/
|
||||
@@ -141,5 +138,4 @@ class JsonControllerTest extends TestCase
|
||||
$response = $this->get(route('json.trigger'));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -31,14 +30,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class NewUserControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class NewUserControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\NewUserController::index
|
||||
* @covers \FireflyIII\Http\Controllers\NewUserController::__construct
|
||||
@@ -69,7 +66,6 @@ class NewUserControllerTest extends TestCase
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$accountRepos->shouldReceive('count')->andReturn(1);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('new-user.index'));
|
||||
$response->assertStatus(302);
|
||||
@@ -89,7 +85,6 @@ class NewUserControllerTest extends TestCase
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$accountRepos->shouldReceive('store')->times(2);
|
||||
|
||||
|
||||
$data = [
|
||||
'bank_name' => 'New bank',
|
||||
'savings_balance' => '1000',
|
||||
@@ -121,5 +116,4 @@ class NewUserControllerTest extends TestCase
|
||||
$response->assertStatus(302);
|
||||
$response->assertSessionHas('success');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -37,14 +36,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class PiggyBankControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class PiggyBankControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\PiggyBankController::add
|
||||
*/
|
||||
@@ -139,7 +136,6 @@ class PiggyBankControllerTest extends TestCase
|
||||
|
||||
$repository->shouldReceive('destroy')->andReturn(true);
|
||||
|
||||
|
||||
$this->session(['piggy-banks.delete.uri' => 'http://localhost']);
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('piggy-banks.destroy', [2]));
|
||||
@@ -240,7 +236,6 @@ class PiggyBankControllerTest extends TestCase
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$repository->shouldReceive('canAddAmount')->once()->andReturn(false);
|
||||
|
||||
|
||||
$data = ['amount' => '1000'];
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('piggy-banks.add', [1]), $data);
|
||||
@@ -297,7 +292,6 @@ class PiggyBankControllerTest extends TestCase
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('piggy-banks.remove', [1]));
|
||||
$response->assertStatus(200);
|
||||
@@ -352,7 +346,6 @@ class PiggyBankControllerTest extends TestCase
|
||||
'targetamount' => '100.123',
|
||||
'account_id' => 2,
|
||||
'amount_currency_id_targetamount' => 1,
|
||||
|
||||
];
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('piggy-banks.store'), $data);
|
||||
@@ -378,7 +371,6 @@ class PiggyBankControllerTest extends TestCase
|
||||
'targetamount' => '100.123',
|
||||
'account_id' => 2,
|
||||
'amount_currency_id_targetamount' => 1,
|
||||
|
||||
];
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('piggy-banks.update', [3]), $data);
|
||||
@@ -386,6 +378,4 @@ class PiggyBankControllerTest extends TestCase
|
||||
$response->assertSessionHas('success');
|
||||
$response->assertRedirect(route('index'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Popup;
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Helpers\Report\PopupReportInterface;
|
||||
use FireflyIII\Models\Account;
|
||||
@@ -35,18 +33,15 @@ use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
use Tests\TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* Class ReportControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Popup
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class ReportControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Popup\ReportController::__construct
|
||||
* @covers \FireflyIII\Http\Controllers\Popup\ReportController::general
|
||||
@@ -176,7 +171,6 @@ class ReportControllerTest extends TestCase
|
||||
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
|
||||
$popupHelper = $this->mock(PopupReportInterface::class);
|
||||
|
||||
|
||||
$budget = factory(Budget::class)->make();
|
||||
$account = factory(Account::class)->make();
|
||||
|
||||
@@ -232,7 +226,6 @@ class ReportControllerTest extends TestCase
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
$uri = route('popup.general') . '?' . http_build_query($arguments);
|
||||
$response = $this->get($uri);
|
||||
$response->assertStatus(500);
|
||||
@@ -385,6 +378,4 @@ class ReportControllerTest extends TestCase
|
||||
$response = $this->get($uri);
|
||||
$response->assertStatus(500);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -36,14 +35,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class PreferencesControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class PreferencesControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\PreferencesController::code
|
||||
* @covers \FireflyIII\Http\Controllers\PreferencesController::getDomain
|
||||
@@ -231,5 +228,4 @@ class PreferencesControllerTest extends TestCase
|
||||
// go to code to get a secret.
|
||||
$response->assertRedirect(route('preferences.code'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -31,14 +30,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class ProfileControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class ProfileControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\ProfileController::changePassword
|
||||
*/
|
||||
@@ -190,5 +187,4 @@ class ProfileControllerTest extends TestCase
|
||||
$response->assertRedirect(route('profile.delete-account'));
|
||||
$response->assertSessionHas('error');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,19 +18,16 @@
|
||||
* 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\Report;
|
||||
|
||||
|
||||
use FireflyIII\Repositories\Account\AccountTaskerInterface;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class AccountControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Report
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -52,10 +49,8 @@ class AccountControllerTest extends TestCase
|
||||
$tasker = $this->mock(AccountTaskerInterface::class);
|
||||
$tasker->shouldReceive('getAccountReport')->andReturn($return);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('report-data.account.general', ['1', '20120101', '20120131']));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Report;
|
||||
|
||||
|
||||
use FireflyIII\Helpers\Collection\Balance;
|
||||
use FireflyIII\Helpers\Report\BalanceReportHelperInterface;
|
||||
use Tests\TestCase;
|
||||
@@ -31,7 +29,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class BalanceControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Report
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -50,5 +47,4 @@ class BalanceControllerTest extends TestCase
|
||||
$response = $this->get(route('report-data.balance.general', ['1', '20120101', '20120131']));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Report;
|
||||
|
||||
|
||||
use FireflyIII\Helpers\Report\BudgetReportHelperInterface;
|
||||
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
@@ -32,7 +30,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class BudgetControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Report
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -70,5 +67,4 @@ class BudgetControllerTest extends TestCase
|
||||
$response = $this->get(route('report-data.budget.period', ['1', '20120101', '20120131']));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Report;
|
||||
|
||||
|
||||
use FireflyIII\Models\Category;
|
||||
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
@@ -32,7 +30,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class CategoryControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Report
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -89,5 +86,4 @@ class CategoryControllerTest extends TestCase
|
||||
$response = $this->get(route('report-data.category.operations', ['1', '20120101', '20120131']));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Report;
|
||||
|
||||
|
||||
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
||||
use FireflyIII\Helpers\Filter\InternalTransferFilter;
|
||||
use FireflyIII\Models\Transaction;
|
||||
@@ -33,7 +31,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class OperationsControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Report
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -55,7 +52,6 @@ class OperationsControllerTest extends TestCase
|
||||
$collector->shouldReceive('addFilter')->withArgs([InternalTransferFilter::class])->andReturnSelf();
|
||||
$collector->shouldReceive('getJournals')->andReturn($transactions);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('report-data.operations.expenses', ['1', '20160101', '20160131']));
|
||||
$response->assertStatus(200);
|
||||
@@ -101,5 +97,4 @@ class OperationsControllerTest extends TestCase
|
||||
$response = $this->get(route('report-data.operations.operations', ['1', '20160101', '20160131']));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
use FireflyIII\Generator\Report\Audit\YearReportGenerator as AYRG;
|
||||
use FireflyIII\Generator\Report\Budget\YearReportGenerator as BYRG;
|
||||
use FireflyIII\Generator\Report\Category\YearReportGenerator as CYRG;
|
||||
@@ -46,14 +44,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class ReportControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class ReportControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\ReportController::auditReport
|
||||
*/
|
||||
@@ -68,7 +64,6 @@ class ReportControllerTest extends TestCase
|
||||
$generator->shouldReceive('setAccounts')->once();
|
||||
$generator->shouldReceive('generate')->andReturn('here-be-report')->once();
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('reports.report.audit', [1, '20160101', '20160131']));
|
||||
$response->assertStatus(200);
|
||||
@@ -189,7 +184,6 @@ class ReportControllerTest extends TestCase
|
||||
$budget = factory(Budget::class)->make();
|
||||
$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection([$budget]));
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('reports.options', ['budget']));
|
||||
$response->assertStatus(200);
|
||||
@@ -458,5 +452,4 @@ class ReportControllerTest extends TestCase
|
||||
$response = $this->get(route('reports.report.tag', [1, 'TagJanuary', '20160101', '20160131']));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -37,14 +36,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class RuleControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class RuleControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\RuleController::create
|
||||
*/
|
||||
@@ -77,7 +74,6 @@ class RuleControllerTest extends TestCase
|
||||
];
|
||||
$this->session(['_old_input' => $old]);
|
||||
|
||||
|
||||
// mock stuff
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
@@ -223,7 +219,7 @@ class RuleControllerTest extends TestCase
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
$data = ['actions' => [1, 2, 3],];
|
||||
$data = ['actions' => [1, 2, 3]];
|
||||
$repository->shouldReceive('reorderRuleActions')->once();
|
||||
|
||||
$this->be($this->user());
|
||||
@@ -241,7 +237,7 @@ class RuleControllerTest extends TestCase
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$data = ['triggers' => [1, 2, 3],];
|
||||
$data = ['triggers' => [1, 2, 3]];
|
||||
$repository->shouldReceive('reorderRuleTriggers')->once();
|
||||
|
||||
$this->be($this->user());
|
||||
@@ -289,7 +285,6 @@ class RuleControllerTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @covers \FireflyIII\Http\Controllers\RuleController::testTriggers
|
||||
* @covers \FireflyIII\Http\Controllers\RuleController::getValidTriggerList
|
||||
*/
|
||||
@@ -419,5 +414,4 @@ class RuleControllerTest extends TestCase
|
||||
$response->assertStatus(302);
|
||||
$response->assertSessionHas('success');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -36,14 +35,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class RuleGroupControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class RuleGroupControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\RuleGroupController::create
|
||||
* @covers \FireflyIII\Http\Controllers\RuleGroupController::__construct
|
||||
@@ -122,7 +119,6 @@ class RuleGroupControllerTest extends TestCase
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('rule-groups.edit', [1]));
|
||||
$response->assertStatus(200);
|
||||
@@ -191,7 +187,6 @@ class RuleGroupControllerTest extends TestCase
|
||||
'description' => 'No description',
|
||||
];
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('rule-groups.store', [1]), $data);
|
||||
$response->assertStatus(302);
|
||||
@@ -239,5 +234,4 @@ class RuleGroupControllerTest extends TestCase
|
||||
$response->assertStatus(302);
|
||||
$response->assertSessionHas('success');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -29,14 +28,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class SearchControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class SearchControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\SearchController::index
|
||||
* @covers \FireflyIII\Http\Controllers\SearchController::__construct
|
||||
@@ -51,5 +48,4 @@ class SearchControllerTest extends TestCase
|
||||
$response->assertStatus(200);
|
||||
$response->assertSee('<ol class="breadcrumb">');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -33,18 +32,15 @@ use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Tests\TestCase;
|
||||
|
||||
|
||||
/**
|
||||
* Class TagControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class TagControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\TagController::create
|
||||
*/
|
||||
@@ -161,7 +157,6 @@ class TagControllerTest extends TestCase
|
||||
$collector->shouldReceive('setRange')->andReturnSelf()->once();
|
||||
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->once();
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('tags.show', [1]));
|
||||
$response->assertStatus(200);
|
||||
@@ -198,7 +193,6 @@ class TagControllerTest extends TestCase
|
||||
];
|
||||
$repository->shouldReceive('sumsOfTag')->andReturn($amounts)->once();
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('tags.show', [1, 'all']));
|
||||
$response->assertStatus(200);
|
||||
@@ -238,7 +232,6 @@ class TagControllerTest extends TestCase
|
||||
];
|
||||
$repository->shouldReceive('sumsOfTag')->andReturn($amounts)->once();
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('tags.show', [1, '2016-01-01']));
|
||||
$response->assertStatus(200);
|
||||
@@ -278,7 +271,6 @@ class TagControllerTest extends TestCase
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
|
||||
$this->session(['tags.edit.uri' => 'http://localhost']);
|
||||
$data = [
|
||||
'tag' => 'Hello updated tag' . rand(999, 10000),
|
||||
@@ -293,5 +285,4 @@ class TagControllerTest extends TestCase
|
||||
$response->assertStatus(302);
|
||||
$response->assertSessionHas('success');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Transaction;
|
||||
|
||||
|
||||
use DB;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
@@ -37,7 +35,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class ConvertControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Transaction
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -217,7 +214,7 @@ class ConvertControllerTest extends TestCase
|
||||
$accountRepos->shouldReceive('store')->andReturn(new Account);
|
||||
|
||||
$deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
|
||||
$data = ['destination_account_expense' => 'New expense name.',];
|
||||
$data = ['destination_account_expense' => 'New expense name.'];
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('transactions.convert.index', ['withdrawal', $deposit->id]), $data);
|
||||
$response->assertStatus(302);
|
||||
@@ -240,7 +237,7 @@ class ConvertControllerTest extends TestCase
|
||||
$accountRepos->shouldReceive('getCashAccount')->andReturn(new Account)->once();
|
||||
|
||||
$deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
|
||||
$data = ['destination_account_expense' => '',];
|
||||
$data = ['destination_account_expense' => ''];
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('transactions.convert.index', ['withdrawal', $deposit->id]), $data);
|
||||
$response->assertStatus(302);
|
||||
@@ -261,7 +258,6 @@ class ConvertControllerTest extends TestCase
|
||||
$repository->shouldReceive('convert')->andReturn($messageBag);
|
||||
$repository->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
|
||||
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
|
||||
$data = [
|
||||
'destination_account_asset' => 2,
|
||||
@@ -360,7 +356,7 @@ class ConvertControllerTest extends TestCase
|
||||
$accountRepos->shouldReceive('store')->andReturn(new Account)->once();
|
||||
|
||||
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
|
||||
$data = ['source_account_revenue' => 'New revenue name.',];
|
||||
$data = ['source_account_revenue' => 'New revenue name.'];
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('transactions.convert.index', ['deposit', $withdrawal->id]), $data);
|
||||
$response->assertStatus(302);
|
||||
@@ -383,7 +379,7 @@ class ConvertControllerTest extends TestCase
|
||||
$accountRepos->shouldReceive('getCashAccount')->andReturn(new Account)->once();
|
||||
|
||||
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
|
||||
$data = ['source_account_revenue' => '',];
|
||||
$data = ['source_account_revenue' => ''];
|
||||
$this->be($this->user());
|
||||
$response = $this->post(route('transactions.convert.index', ['deposit', $withdrawal->id]), $data);
|
||||
$response->assertStatus(302);
|
||||
@@ -414,6 +410,4 @@ class ConvertControllerTest extends TestCase
|
||||
$response->assertStatus(302);
|
||||
$response->assertRedirect(route('transactions.show', [$withdrawal->id]));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Transaction;
|
||||
|
||||
|
||||
use DB;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
@@ -36,7 +34,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class MassControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Transaction
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -193,7 +190,6 @@ class MassControllerTest extends TestCase
|
||||
$repository->shouldReceive('update')->once();
|
||||
$repository->shouldReceive('find')->once()->andReturn($deposit);
|
||||
|
||||
|
||||
$this->session(['transactions.mass-edit.uri' => 'http://localhost']);
|
||||
|
||||
$data = [
|
||||
|
||||
@@ -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\Transaction;
|
||||
|
||||
|
||||
use DB;
|
||||
use FireflyIII\Events\StoredTransactionJournal;
|
||||
use FireflyIII\Events\UpdatedTransactionJournal;
|
||||
@@ -45,14 +43,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class SingleControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Transaction
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class SingleControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::cloneTransaction
|
||||
*/
|
||||
@@ -78,7 +74,6 @@ class SingleControllerTest extends TestCase
|
||||
$piggyRepos = $this->mock(PiggyBankRepositoryInterface::class);
|
||||
$piggyRepos->shouldReceive('getPiggyBanksWithAmount')->andReturn(new Collection)->once();
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('transactions.create', ['withdrawal']));
|
||||
$response->assertStatus(200);
|
||||
@@ -206,7 +201,6 @@ class SingleControllerTest extends TestCase
|
||||
$response->assertStatus(302);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::edit
|
||||
* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::groupedAccountList
|
||||
@@ -317,14 +311,12 @@ class SingleControllerTest extends TestCase
|
||||
$messages = new MessageBag;
|
||||
$messages->add('attachments', 'Fake error');
|
||||
|
||||
|
||||
// mock attachment helper, trigger an error AND and info thing.
|
||||
$attachmentRepo = $this->mock(AttachmentHelperInterface::class);
|
||||
$attachmentRepo->shouldReceive('saveAttachmentsForModel');
|
||||
$attachmentRepo->shouldReceive('getErrors')->andReturn($errors);
|
||||
$attachmentRepo->shouldReceive('getMessages')->andReturn($messages);
|
||||
|
||||
|
||||
$this->session(['transactions.create.uri' => 'http://localhost']);
|
||||
$this->be($this->user());
|
||||
|
||||
@@ -360,7 +352,6 @@ class SingleControllerTest extends TestCase
|
||||
$journal->description = 'New journal';
|
||||
$journal->transactionType()->associate($type);
|
||||
|
||||
|
||||
$repository->shouldReceive('update')->andReturn($journal);
|
||||
$repository->shouldReceive('first')->times(2)->andReturn(new TransactionJournal);
|
||||
|
||||
@@ -389,7 +380,5 @@ class SingleControllerTest extends TestCase
|
||||
$response->assertSee('Updated groceries');
|
||||
// has bread crumb
|
||||
$response->assertSee('<ol class="breadcrumb">');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Transaction;
|
||||
|
||||
|
||||
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\Transaction;
|
||||
@@ -40,7 +38,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class SplitControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers\Transaction
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -55,7 +52,6 @@ class SplitControllerTest extends TestCase
|
||||
*/
|
||||
public function testEdit()
|
||||
{
|
||||
|
||||
$currencyRepository = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$accountRepository = $this->mock(AccountRepositoryInterface::class);
|
||||
$budgetRepository = $this->mock(BudgetRepositoryInterface::class);
|
||||
@@ -71,7 +67,6 @@ class SplitControllerTest extends TestCase
|
||||
$budgetRepository->shouldReceive('getActiveBudgets')->andReturn(new Collection);
|
||||
$tasker->shouldReceive('getTransactionsOverview')->andReturn($transactions->toArray());
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('transactions.split.edit', [$deposit->id]));
|
||||
$response->assertStatus(200);
|
||||
@@ -98,7 +93,6 @@ class SplitControllerTest extends TestCase
|
||||
*/
|
||||
public function testEditSingle()
|
||||
{
|
||||
|
||||
$currencyRepository = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$accountRepository = $this->mock(AccountRepositoryInterface::class);
|
||||
$budgetRepository = $this->mock(BudgetRepositoryInterface::class);
|
||||
@@ -114,7 +108,6 @@ class SplitControllerTest extends TestCase
|
||||
$budgetRepository->shouldReceive('getActiveBudgets')->andReturn(new Collection);
|
||||
$tasker->shouldReceive('getTransactionsOverview')->andReturn($transactions->toArray());
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('transactions.split.edit', [$deposit->id]));
|
||||
$response->assertStatus(200);
|
||||
@@ -158,7 +151,6 @@ class SplitControllerTest extends TestCase
|
||||
$repository->shouldReceive('updateSplitJournal')->andReturn($deposit);
|
||||
$repository->shouldReceive('first')->times(2)->andReturn(new TransactionJournal);
|
||||
|
||||
|
||||
$attachmentRepos = $this->mock(AttachmentHelperInterface::class);
|
||||
$attachmentRepos->shouldReceive('saveAttachmentsForModel');
|
||||
$attachmentRepos->shouldReceive('getMessages')->andReturn(new MessageBag);
|
||||
@@ -191,5 +183,4 @@ class SplitControllerTest extends TestCase
|
||||
$response->assertStatus(302);
|
||||
$response->assertSessionMissing('success');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -36,15 +35,12 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class TransactionControllerTest
|
||||
*
|
||||
* @package Tests\Feature\Controllers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
*/
|
||||
class TransactionControllerTest extends TestCase
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\TransactionController::index
|
||||
* @covers \FireflyIII\Http\Controllers\TransactionController::__construct
|
||||
@@ -254,5 +250,4 @@ class TransactionControllerTest extends TestCase
|
||||
$response = $this->get(route('transactions.show', [$journal->id]));
|
||||
$response->assertStatus(302);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,10 +18,8 @@
|
||||
* 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;
|
||||
|
||||
use Tests\TestCase;
|
||||
@@ -30,8 +28,6 @@ class ExampleTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testBasicTest()
|
||||
{
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* 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;
|
||||
@@ -34,7 +33,6 @@ use Mockery;
|
||||
/**
|
||||
* Class TestCase
|
||||
*
|
||||
* @package Tests
|
||||
* @SuppressWarnings(PHPMD.NumberOfChildren)
|
||||
*/
|
||||
abstract class TestCase extends BaseTestCase
|
||||
@@ -58,9 +56,8 @@ abstract class TestCase extends BaseTestCase
|
||||
]
|
||||
);
|
||||
// set period to match?
|
||||
|
||||
}
|
||||
if ($range === 'custom') {
|
||||
if ('custom' === $range) {
|
||||
$this->session(
|
||||
[
|
||||
'start' => Carbon::now()->subDays(20),
|
||||
@@ -119,5 +116,4 @@ abstract class TestCase extends BaseTestCase
|
||||
|
||||
return $object;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,10 +18,8 @@
|
||||
* 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\Unit;
|
||||
|
||||
use Tests\TestCase;
|
||||
@@ -30,8 +28,6 @@ class ExampleTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testBasicTest()
|
||||
{
|
||||
|
||||
@@ -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\Unit\Handlers\Events;
|
||||
|
||||
|
||||
use FireflyIII\Events\RegisteredUser;
|
||||
use FireflyIII\Events\RequestedNewPassword;
|
||||
use FireflyIII\Handlers\Events\UserEventHandler;
|
||||
@@ -36,7 +34,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class UserEventHandlerTest
|
||||
*
|
||||
* @package Tests\Unit\Handlers\Events
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -76,7 +73,7 @@ class UserEventHandlerTest extends TestCase
|
||||
|
||||
Mail::assertSent(
|
||||
RequestedNewPasswordMail::class, function ($mail) use ($user) {
|
||||
return $mail->hasTo($user->email) && $mail->ipAddress === '127.0.0.1';
|
||||
return $mail->hasTo($user->email) && '127.0.0.1' === $mail->ipAddress;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -99,11 +96,10 @@ class UserEventHandlerTest extends TestCase
|
||||
// must send user an email:
|
||||
Mail::assertSent(
|
||||
RegisteredUserMail::class, function ($mail) use ($user) {
|
||||
return $mail->hasTo($user->email) && $mail->ipAddress === '127.0.0.1';
|
||||
return $mail->hasTo($user->email) && '127.0.0.1' === $mail->ipAddress;
|
||||
}
|
||||
);
|
||||
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Unit\Helpers;
|
||||
|
||||
|
||||
use FireflyIII\Helpers\Attachments\AttachmentHelper;
|
||||
use FireflyIII\Models\Attachment;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
@@ -34,7 +32,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class AttachmentHelperTest
|
||||
*
|
||||
* @package Tests\Unit\Helpers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -63,7 +60,6 @@ class AttachmentHelperTest extends TestCase
|
||||
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::hasFile
|
||||
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getMessages
|
||||
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getErrors
|
||||
*
|
||||
*/
|
||||
public function testInvalidMime()
|
||||
{
|
||||
@@ -93,7 +89,6 @@ class AttachmentHelperTest extends TestCase
|
||||
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getMessages
|
||||
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getErrors
|
||||
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getAttachments
|
||||
*
|
||||
*/
|
||||
public function testSave()
|
||||
{
|
||||
@@ -129,7 +124,6 @@ class AttachmentHelperTest extends TestCase
|
||||
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getMessages
|
||||
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getErrors
|
||||
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::getAttachments
|
||||
*
|
||||
*/
|
||||
public function testSaveSecond()
|
||||
{
|
||||
@@ -146,6 +140,4 @@ class AttachmentHelperTest extends TestCase
|
||||
$this->assertCount(0, $messages);
|
||||
$this->assertEquals('Uploaded file "apple-touch-icon.png" is already attached to this object.', $errors->first());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Unit\Helpers;
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Helpers\Chart\MetaPieChart;
|
||||
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
||||
@@ -40,7 +38,6 @@ use Tests\TestCase;
|
||||
/**
|
||||
* Class MetaPieChartTest
|
||||
*
|
||||
* @package Tests\Unit\Helpers
|
||||
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
||||
@@ -87,7 +84,6 @@ class MetaPieChartTest extends TestCase
|
||||
$accountRepos->shouldReceive('find')->withArgs([1])->andReturn($accounts[1]);
|
||||
$accountRepos->shouldReceive('find')->withArgs([2])->andReturn($accounts[2]);
|
||||
|
||||
|
||||
$helper = new MetaPieChart();
|
||||
$helper->setUser($this->user());
|
||||
$helper->setStart($som);
|
||||
@@ -98,12 +94,10 @@ class MetaPieChartTest extends TestCase
|
||||
$keys = array_keys($chart);
|
||||
$this->assertEquals($keys[0], $accounts[1]->name);
|
||||
$this->assertEquals($keys[1], $accounts[2]->name);
|
||||
$this->assertTrue(bccomp('1000', $chart[$accounts[1]->name]) === 0);
|
||||
$this->assertTrue(bccomp('1000', $chart[$accounts[2]->name]) === 0);
|
||||
$this->assertTrue(0 === bccomp('1000', $chart[$accounts[1]->name]));
|
||||
$this->assertTrue(0 === bccomp('1000', $chart[$accounts[2]->name]));
|
||||
|
||||
$this->assertTrue(true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,7 +143,6 @@ class MetaPieChartTest extends TestCase
|
||||
$accountRepos->shouldReceive('find')->withArgs([1])->andReturn($accounts[1]);
|
||||
$accountRepos->shouldReceive('find')->withArgs([2])->andReturn($accounts[2]);
|
||||
|
||||
|
||||
$helper = new MetaPieChart();
|
||||
$helper->setCollectOtherObjects(true);
|
||||
$helper->setUser($this->user());
|
||||
@@ -161,20 +154,18 @@ class MetaPieChartTest extends TestCase
|
||||
$keys = array_keys($chart);
|
||||
$this->assertEquals($keys[0], $accounts[1]->name);
|
||||
$this->assertEquals($keys[1], $accounts[2]->name);
|
||||
$this->assertTrue(bccomp('1000', $chart[$accounts[1]->name]) === 0);
|
||||
$this->assertTrue(bccomp('1000', $chart[$accounts[2]->name]) === 0);
|
||||
$this->assertTrue(bccomp('1000', $chart['Everything else']) === 0);
|
||||
$this->assertTrue(0 === bccomp('1000', $chart[$accounts[1]->name]));
|
||||
$this->assertTrue(0 === bccomp('1000', $chart[$accounts[2]->name]));
|
||||
$this->assertTrue(0 === bccomp('1000', $chart['Everything else']));
|
||||
|
||||
$this->assertTrue(true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function fakeOthers(): Collection
|
||||
{
|
||||
$set = new Collection;
|
||||
|
||||
for ($i = 0; $i < 30; $i++) {
|
||||
for ($i = 0; $i < 30; ++$i) {
|
||||
$transaction = new Transaction;
|
||||
|
||||
// basic fields.
|
||||
@@ -193,7 +184,7 @@ class MetaPieChartTest extends TestCase
|
||||
private function fakeTransactions(): Collection
|
||||
{
|
||||
$set = new Collection;
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
for ($i = 0; $i < 10; ++$i) {
|
||||
$transaction = new Transaction;
|
||||
|
||||
// basic fields.
|
||||
@@ -206,7 +197,7 @@ class MetaPieChartTest extends TestCase
|
||||
$set->push($transaction);
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
for ($i = 0; $i < 10; ++$i) {
|
||||
$transaction = new Transaction;
|
||||
|
||||
// basic fields.
|
||||
@@ -221,5 +212,4 @@ class MetaPieChartTest extends TestCase
|
||||
|
||||
return $set;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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\Unit\Import\Converter;
|
||||
@@ -28,8 +27,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class AmountTest
|
||||
*
|
||||
* @package Tests\Unit\Import\Converter
|
||||
*/
|
||||
class AmountTest extends TestCase
|
||||
{
|
||||
@@ -83,12 +80,11 @@ class AmountTest extends TestCase
|
||||
'1.234' => '1234',
|
||||
'1.234,5' => '1234.5',
|
||||
'1.234,56' => '1234.56',
|
||||
|
||||
];
|
||||
foreach ($values as $value => $expected) {
|
||||
$converter = new Amount;
|
||||
$result = $converter->convert($value);
|
||||
$this->assertEquals($expected, $result,sprintf('The original value was %s', $value));
|
||||
$this->assertEquals($expected, $result, sprintf('The original value was %s', $value));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +97,4 @@ class AmountTest extends TestCase
|
||||
$result = $converter->convert(null);
|
||||
$this->assertEquals('0', $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Unit\TransactionRules\Actions;
|
||||
|
||||
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use FireflyIII\Models\Tag;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
@@ -46,7 +44,6 @@ class AddTagTest extends TestCase
|
||||
$result = $action->act($journal);
|
||||
$this->assertFalse($result);
|
||||
$this->assertDatabaseHas('tag_transaction_journal', ['tag_id' => 2, 'transaction_journal_id' => 1]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,7 +61,5 @@ class AddTagTest extends TestCase
|
||||
// find newly created tag:
|
||||
$tag = Tag::orderBy('id', 'DESC')->first();
|
||||
$this->assertDatabaseHas('tag_transaction_journal', ['tag_id' => $tag->id, 'transaction_journal_id' => 1]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Unit\TransactionRules\Actions;
|
||||
|
||||
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Actions\AppendDescription;
|
||||
@@ -48,7 +46,5 @@ class AppendDescriptionTest extends TestCase
|
||||
|
||||
$journal = TransactionJournal::find(1);
|
||||
$this->assertEquals($oldDescription . 'APPEND', $journal->description);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Unit\TransactionRules\Actions;
|
||||
|
||||
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
@@ -32,8 +30,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class AppendNotesTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Actions
|
||||
*/
|
||||
class AppendNotesTest extends TestCase
|
||||
{
|
||||
@@ -64,7 +60,6 @@ class AppendNotesTest extends TestCase
|
||||
|
||||
$newNote = $journal->notes()->first();
|
||||
$this->assertEquals($start . $toAppend, $newNote->text);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,6 +85,5 @@ class AppendNotesTest extends TestCase
|
||||
|
||||
$newNote = $journal->notes()->first();
|
||||
$this->assertEquals($toAppend, $newNote->text);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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\Unit\TransactionRules\Actions;
|
||||
|
||||
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Actions\ClearBudget;
|
||||
@@ -31,8 +29,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class ClearBudgetTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Actions
|
||||
*/
|
||||
class ClearBudgetTest extends TestCase
|
||||
{
|
||||
@@ -57,6 +53,5 @@ class ClearBudgetTest extends TestCase
|
||||
|
||||
// assert result
|
||||
$this->assertEquals(0, $journal->budgets()->count());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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\Unit\TransactionRules\Actions;
|
||||
@@ -30,8 +29,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class ClearCategoryTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Actions
|
||||
*/
|
||||
class ClearCategoryTest extends TestCase
|
||||
{
|
||||
@@ -56,6 +53,5 @@ class ClearCategoryTest extends TestCase
|
||||
|
||||
// assert result
|
||||
$this->assertEquals(0, $journal->categories()->count());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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\Unit\TransactionRules\Actions;
|
||||
|
||||
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
@@ -32,8 +30,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class ClearNotesTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Actions
|
||||
*/
|
||||
class ClearNotesTest extends TestCase
|
||||
{
|
||||
@@ -63,6 +59,5 @@ class ClearNotesTest extends TestCase
|
||||
|
||||
// assert result
|
||||
$this->assertEquals(0, $journal->notes()->count());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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\Unit\TransactionRules\Actions;
|
||||
|
||||
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Actions\PrependDescription;
|
||||
@@ -31,8 +29,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class PrependDescriptionTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Actions
|
||||
*/
|
||||
class PrependDescriptionTest extends TestCase
|
||||
{
|
||||
@@ -59,6 +55,5 @@ class PrependDescriptionTest extends TestCase
|
||||
|
||||
// assert result
|
||||
$this->assertEquals($prepend . $description, $journal->description);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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\Unit\TransactionRules\Actions;
|
||||
|
||||
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
@@ -32,8 +30,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class PrependNotesTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Actions
|
||||
*/
|
||||
class PrependNotesTest extends TestCase
|
||||
{
|
||||
@@ -64,7 +60,6 @@ class PrependNotesTest extends TestCase
|
||||
|
||||
$newNote = $journal->notes()->first();
|
||||
$this->assertEquals($toPrepend . $start, $newNote->text);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,6 +85,5 @@ class PrependNotesTest extends TestCase
|
||||
|
||||
$newNote = $journal->notes()->first();
|
||||
$this->assertEquals($toPrepend, $newNote->text);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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\Unit\TransactionRules\Actions;
|
||||
|
||||
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Actions\RemoveAllTags;
|
||||
@@ -31,8 +29,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class RemoveAllTagsTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Actions
|
||||
*/
|
||||
class RemoveAllTagsTest extends TestCase
|
||||
{
|
||||
|
||||
@@ -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\Unit\TransactionRules\Actions;
|
||||
|
||||
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Actions\RemoveTag;
|
||||
@@ -31,8 +29,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class RemoveTagTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Actions
|
||||
*/
|
||||
class RemoveTagTest extends TestCase
|
||||
{
|
||||
|
||||
@@ -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\Unit\TransactionRules\Actions;
|
||||
|
||||
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Actions\SetBudget;
|
||||
@@ -31,8 +29,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class SetBudgetTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Actions
|
||||
*/
|
||||
class SetBudgetTest extends TestCase
|
||||
{
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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\Unit\TransactionRules\Actions;
|
||||
@@ -30,8 +29,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class SetCategoryTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Actions
|
||||
*/
|
||||
class SetCategoryTest extends TestCase
|
||||
{
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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\Unit\TransactionRules\Actions;
|
||||
@@ -30,8 +29,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class SetDescriptionTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Actions
|
||||
*/
|
||||
class SetDescriptionTest extends TestCase
|
||||
{
|
||||
@@ -58,6 +55,5 @@ class SetDescriptionTest extends TestCase
|
||||
|
||||
// assert result
|
||||
$this->assertEquals($newDescription, $journal->description);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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\Unit\TransactionRules\Actions;
|
||||
|
||||
|
||||
use DB;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\RuleAction;
|
||||
@@ -37,8 +35,6 @@ use Tests\TestCase;
|
||||
* Try split journal
|
||||
*
|
||||
* Class SetDestinationAccountTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Actions
|
||||
*/
|
||||
class SetDestinationAccountTest extends TestCase
|
||||
{
|
||||
@@ -183,5 +179,4 @@ class SetDestinationAccountTest extends TestCase
|
||||
$result = $action->act($journal);
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Unit\TransactionRules\Actions;
|
||||
|
||||
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
@@ -32,8 +30,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class SetNotesTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Actions
|
||||
*/
|
||||
class SetNotesTest extends TestCase
|
||||
{
|
||||
@@ -64,7 +60,6 @@ class SetNotesTest extends TestCase
|
||||
// assert result
|
||||
$this->assertEquals(1, $journal->notes()->count());
|
||||
$this->assertEquals($note->id, $journal->notes()->first()->id);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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\Unit\TransactionRules\Actions;
|
||||
@@ -34,8 +33,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class SetSourceAccountTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Actions
|
||||
*/
|
||||
class SetSourceAccountTest extends TestCase
|
||||
{
|
||||
@@ -180,5 +177,4 @@ class SetSourceAccountTest extends TestCase
|
||||
$result = $action->act($journal);
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,20 +18,16 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\AmountExactly;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class AmountExactlyTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class AmountExactlyTest extends TestCase
|
||||
{
|
||||
@@ -78,6 +74,4 @@ class AmountExactlyTest extends TestCase
|
||||
$result = AmountExactly::willMatchEverything($value);
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,20 +18,16 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\AmountLess;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class AmountLessTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class AmountLessTest extends TestCase
|
||||
{
|
||||
@@ -90,6 +86,4 @@ class AmountLessTest extends TestCase
|
||||
$result = AmountLess::willMatchEverything($value);
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,20 +18,16 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\AmountMore;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class AmountMoreTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class AmountMoreTest extends TestCase
|
||||
{
|
||||
@@ -100,6 +96,4 @@ class AmountMoreTest extends TestCase
|
||||
$result = AmountMore::willMatchEverything($value);
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,24 +18,19 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\BudgetIs;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class BudgetIsTest
|
||||
*
|
||||
* @package Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class BudgetIsTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\BudgetIs::triggered
|
||||
*/
|
||||
@@ -64,7 +59,6 @@ class BudgetIsTest extends TestCase
|
||||
$journal->budgets()->save($budget);
|
||||
$this->assertEquals(1, $journal->budgets()->count());
|
||||
|
||||
|
||||
$trigger = BudgetIs::makeFromStrings($otherBudget->name, false);
|
||||
$result = $trigger->triggered($journal);
|
||||
$this->assertFalse($result);
|
||||
@@ -84,7 +78,6 @@ class BudgetIsTest extends TestCase
|
||||
$this->assertEquals(0, $journal->budgets()->count());
|
||||
$this->assertEquals(1, $transaction->budgets()->count());
|
||||
|
||||
|
||||
$trigger = BudgetIs::makeFromStrings($budget->name, false);
|
||||
$result = $trigger->triggered($journal);
|
||||
$this->assertTrue($result);
|
||||
|
||||
@@ -18,24 +18,19 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\CategoryIs;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class CategoryIsTest
|
||||
*
|
||||
* @package Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class CategoryIsTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\CategoryIs::triggered
|
||||
*/
|
||||
@@ -64,7 +59,6 @@ class CategoryIsTest extends TestCase
|
||||
$journal->categories()->save($category);
|
||||
$this->assertEquals(1, $journal->categories()->count());
|
||||
|
||||
|
||||
$trigger = CategoryIs::makeFromStrings($otherCategory->name, false);
|
||||
$result = $trigger->triggered($journal);
|
||||
$this->assertFalse($result);
|
||||
@@ -84,7 +78,6 @@ class CategoryIsTest extends TestCase
|
||||
$this->assertEquals(0, $journal->categories()->count());
|
||||
$this->assertEquals(1, $transaction->categories()->count());
|
||||
|
||||
|
||||
$trigger = CategoryIs::makeFromStrings($category->name, false);
|
||||
$result = $trigger->triggered($journal);
|
||||
$this->assertTrue($result);
|
||||
|
||||
@@ -18,20 +18,16 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\DescriptionContains;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class DescriptionContains
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class DescriptionContainsTest extends TestCase
|
||||
{
|
||||
|
||||
@@ -18,20 +18,16 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\DescriptionEnds;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class DescriptionEnds
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class DescriptionEndsTest extends TestCase
|
||||
{
|
||||
|
||||
@@ -18,20 +18,16 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\DescriptionIs;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class DescriptionIs
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class DescriptionIsTest extends TestCase
|
||||
{
|
||||
|
||||
@@ -18,20 +18,16 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\DescriptionStarts;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class DescriptionStarts
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class DescriptionStartsTest extends TestCase
|
||||
{
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
@@ -29,12 +28,9 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class FromAccountContainsTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class FromAccountContainsTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountContains::triggered
|
||||
*/
|
||||
@@ -90,6 +86,4 @@ class FromAccountContainsTest extends TestCase
|
||||
$result = FromAccountContains::willMatchEverything($value);
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
@@ -29,12 +28,9 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class FromAccountEndsTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class FromAccountEndsTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountEnds::triggered
|
||||
*/
|
||||
@@ -104,6 +100,4 @@ class FromAccountEndsTest extends TestCase
|
||||
$result = FromAccountEnds::willMatchEverything($value);
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
@@ -29,12 +28,9 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class FromAccountIsTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class FromAccountIsTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountIs::triggered
|
||||
*/
|
||||
@@ -49,7 +45,6 @@ class FromAccountIsTest extends TestCase
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountIs::triggered
|
||||
*/
|
||||
@@ -91,5 +86,4 @@ class FromAccountIsTest extends TestCase
|
||||
$result = FromAccountIs::willMatchEverything($value);
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
@@ -29,12 +28,9 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class FromAccountStartsTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class FromAccountStartsTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\FromAccountStarts::triggered
|
||||
*/
|
||||
@@ -104,6 +100,4 @@ class FromAccountStartsTest extends TestCase
|
||||
$result = FromAccountStarts::willMatchEverything($value);
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
@@ -29,8 +28,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class HasAnyBudgetTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class HasAnyBudgetTest extends TestCase
|
||||
{
|
||||
@@ -76,7 +73,7 @@ class HasAnyBudgetTest extends TestCase
|
||||
// append to transaction
|
||||
foreach ($journal->transactions()->get() as $index => $transaction) {
|
||||
$transaction->budgets()->detach();
|
||||
if ($index === 0) {
|
||||
if (0 === $index) {
|
||||
$transaction->budgets()->save($budget);
|
||||
}
|
||||
}
|
||||
@@ -95,5 +92,4 @@ class HasAnyBudgetTest extends TestCase
|
||||
$result = HasAnyBudget::willMatchEverything($value);
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
@@ -29,8 +28,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class HasAnyCategoryTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class HasAnyCategoryTest extends TestCase
|
||||
{
|
||||
@@ -76,7 +73,7 @@ class HasAnyCategoryTest extends TestCase
|
||||
// append to transaction
|
||||
foreach ($journal->transactions()->get() as $index => $transaction) {
|
||||
$transaction->categories()->detach();
|
||||
if ($index === 0) {
|
||||
if (0 === $index) {
|
||||
$transaction->categories()->save($category);
|
||||
}
|
||||
}
|
||||
@@ -95,5 +92,4 @@ class HasAnyCategoryTest extends TestCase
|
||||
$result = HasAnyCategory::willMatchEverything($value);
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
@@ -29,8 +28,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class HasAnyTagTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class HasAnyTagTest extends TestCase
|
||||
{
|
||||
@@ -72,5 +69,4 @@ class HasAnyTagTest extends TestCase
|
||||
$result = HasAnyTag::willMatchEverything($value);
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
@@ -29,8 +28,6 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class HasAttachmentTest
|
||||
*
|
||||
* @package Tests\Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class HasAttachmentTest extends TestCase
|
||||
{
|
||||
@@ -81,5 +78,4 @@ class HasAttachmentTest extends TestCase
|
||||
$result = HasAttachment::willMatchEverything($value);
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,24 +18,19 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\HasNoBudget;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class HasNoBudgetTest
|
||||
*
|
||||
* @package Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class HasNoBudgetTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\HasNoBudget::triggered
|
||||
*/
|
||||
@@ -61,7 +56,6 @@ class HasNoBudgetTest extends TestCase
|
||||
$journal->budgets()->detach();
|
||||
$this->assertEquals(0, $journal->budgets()->count());
|
||||
|
||||
|
||||
$trigger = HasNoBudget::makeFromStrings('', false);
|
||||
$result = $trigger->triggered($journal);
|
||||
$this->assertTrue($result);
|
||||
@@ -81,7 +75,6 @@ class HasNoBudgetTest extends TestCase
|
||||
$this->assertEquals(0, $journal->budgets()->count());
|
||||
$this->assertEquals(1, $transaction->budgets()->count());
|
||||
|
||||
|
||||
$trigger = HasNoBudget::makeFromStrings('', false);
|
||||
$result = $trigger->triggered($journal);
|
||||
$this->assertFalse($result);
|
||||
|
||||
@@ -18,24 +18,19 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\HasNoCategory;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class HasNoCategoryTest
|
||||
*
|
||||
* @package Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class HasNoCategoryTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\HasNoCategory::triggered
|
||||
*/
|
||||
@@ -61,7 +56,6 @@ class HasNoCategoryTest extends TestCase
|
||||
$journal->categories()->detach();
|
||||
$this->assertEquals(0, $journal->categories()->count());
|
||||
|
||||
|
||||
$trigger = HasNoCategory::makeFromStrings('', false);
|
||||
$result = $trigger->triggered($journal);
|
||||
$this->assertTrue($result);
|
||||
@@ -81,7 +75,6 @@ class HasNoCategoryTest extends TestCase
|
||||
$this->assertEquals(0, $journal->categories()->count());
|
||||
$this->assertEquals(1, $transaction->categories()->count());
|
||||
|
||||
|
||||
$trigger = HasNoCategory::makeFromStrings('', false);
|
||||
$result = $trigger->triggered($journal);
|
||||
$this->assertFalse($result);
|
||||
|
||||
@@ -18,24 +18,19 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\HasNoTag;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class HasNoTagTest
|
||||
*
|
||||
* @package Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class HasNoTagTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\HasNoTag::triggered
|
||||
*/
|
||||
@@ -45,7 +40,6 @@ class HasNoTagTest extends TestCase
|
||||
$journal->tags()->detach();
|
||||
$this->assertEquals(0, $journal->tags()->count());
|
||||
|
||||
|
||||
$trigger = HasNoTag::makeFromStrings('', false);
|
||||
$result = $trigger->triggered($journal);
|
||||
$this->assertTrue($result);
|
||||
|
||||
@@ -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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\NotesAny;
|
||||
@@ -31,12 +29,9 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class NotesAnyTest
|
||||
*
|
||||
* @package Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class NotesAnyTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\NotesAny::triggered
|
||||
*/
|
||||
|
||||
@@ -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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\NotesAre;
|
||||
@@ -31,12 +29,9 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class NotesAreTest
|
||||
*
|
||||
* @package Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class NotesAreTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\NotesAre::triggered
|
||||
*/
|
||||
@@ -97,7 +92,6 @@ class NotesAreTest extends TestCase
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\NotesAre::willMatchEverything
|
||||
*/
|
||||
|
||||
@@ -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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\NotesContain;
|
||||
@@ -31,12 +29,9 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class NotesContainTest
|
||||
*
|
||||
* @package Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class NotesContainTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\NotesContain::triggered
|
||||
*/
|
||||
@@ -123,7 +118,6 @@ class NotesContainTest extends TestCase
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\NotesContain::willMatchEverything
|
||||
*/
|
||||
|
||||
@@ -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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\NotesEmpty;
|
||||
@@ -31,12 +29,9 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class NotesEmptyTest
|
||||
*
|
||||
* @package Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class NotesEmptyTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\NotesEmpty::triggered
|
||||
*/
|
||||
@@ -90,5 +85,4 @@ class NotesEmptyTest extends TestCase
|
||||
$result = NotesEmpty::willMatchEverything($value);
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\NotesEnd;
|
||||
@@ -31,12 +29,9 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class NotesEndTest
|
||||
*
|
||||
* @package Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class NotesEndTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\NotesEnd::triggered
|
||||
*/
|
||||
@@ -95,7 +90,6 @@ class NotesEndTest extends TestCase
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\NotesEnd::willMatchEverything
|
||||
*/
|
||||
|
||||
@@ -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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\NotesStart;
|
||||
@@ -31,12 +29,9 @@ use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class NotesStartTest
|
||||
*
|
||||
* @package Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class NotesStartTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\NotesStart::triggered
|
||||
*/
|
||||
@@ -95,7 +90,6 @@ class NotesStartTest extends TestCase
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\NotesStart::willMatchEverything
|
||||
*/
|
||||
|
||||
@@ -18,24 +18,19 @@
|
||||
* 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\Unit\TransactionRules\Triggers;
|
||||
|
||||
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\TransactionRules\Triggers\TagIs;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Class TagIsTest
|
||||
*
|
||||
* @package Unit\TransactionRules\Triggers
|
||||
*/
|
||||
class TagIsTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\TagIs::triggered
|
||||
*/
|
||||
@@ -61,7 +56,7 @@ class TagIsTest extends TestCase
|
||||
$search = '';
|
||||
foreach ($tags as $index => $tag) {
|
||||
$journal->tags()->save($tag);
|
||||
if ($index === 1) {
|
||||
if (1 === $index) {
|
||||
$search = $tag->tag;
|
||||
}
|
||||
}
|
||||
@@ -82,7 +77,6 @@ class TagIsTest extends TestCase
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\TransactionRules\Triggers\TagIs::willMatchEverything
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user