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\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">');
}
}