Code cleanup.

This commit is contained in:
James Cole
2017-11-22 21:12:27 +01:00
parent 4e6b782204
commit 781ca052d8
142 changed files with 213 additions and 859 deletions

View File

@@ -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]);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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());
}
}

View File

@@ -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());
}
}

View File

@@ -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());
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
/**

View File

@@ -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);
}
}