mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-20 11:19:16 +00:00
110 lines
3.2 KiB
PHP
110 lines
3.2 KiB
PHP
<?php
|
|
/**
|
|
* ConvertControllerTest.php
|
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
|
*
|
|
* This software may be modified and distributed under the terms of the
|
|
* Creative Commons Attribution-ShareAlike 4.0 International License.
|
|
*
|
|
* See the LICENSE file for details.
|
|
*/
|
|
|
|
namespace Transaction;
|
|
|
|
use TestCase;
|
|
|
|
/**
|
|
* Generated by PHPUnit_SkeletonGenerator on 2016-12-10 at 05:51:43.
|
|
*/
|
|
class ConvertControllerTest extends TestCase
|
|
{
|
|
|
|
|
|
/**
|
|
* Sets up the fixture, for example, opens a network connection.
|
|
* This method is called before a test is executed.
|
|
*/
|
|
public function setUp()
|
|
{
|
|
parent::setUp();
|
|
}
|
|
|
|
/**
|
|
* @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::index
|
|
*/
|
|
public function testIndexDepositTransfer()
|
|
{
|
|
$this->be($this->user());
|
|
$this->call('get', route('transactions.convert.index', ['transfer', 683]));
|
|
$this->assertResponseStatus(200);
|
|
$this->see('Convert a deposit into a transfer');
|
|
}
|
|
|
|
/**
|
|
* @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::index
|
|
*/
|
|
public function testIndexDepositWithdrawal()
|
|
{
|
|
$this->be($this->user());
|
|
$this->call('get', route('transactions.convert.index', ['withdrawal', 683]));
|
|
$this->assertResponseStatus(200);
|
|
$this->see('Convert a deposit into a withdrawal');
|
|
}
|
|
|
|
/**
|
|
* @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::index
|
|
*/
|
|
public function testIndexTransferDeposit()
|
|
{
|
|
$this->be($this->user());
|
|
$this->call('get', route('transactions.convert.index', ['deposit', 684]));
|
|
$this->assertResponseStatus(200);
|
|
$this->see('Convert a transfer into a deposit');
|
|
}
|
|
|
|
/**
|
|
* @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::index
|
|
*/
|
|
public function testIndexTransferWithdrawal()
|
|
{
|
|
$this->be($this->user());
|
|
$this->call('get', route('transactions.convert.index', ['withdrawal', 684]));
|
|
$this->assertResponseStatus(200);
|
|
$this->see('Convert a transfer into a withdrawal');
|
|
}
|
|
|
|
/**
|
|
* @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::index
|
|
*/
|
|
public function testIndexWithdrawalDeposit()
|
|
{
|
|
$this->be($this->user());
|
|
$this->call('get', route('transactions.convert.index', ['deposit', 672]));
|
|
$this->assertResponseStatus(200);
|
|
$this->see('Convert a withdrawal into a deposit');
|
|
}
|
|
|
|
/**
|
|
* @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::index
|
|
*/
|
|
public function testIndexWithdrawalTransfer()
|
|
{
|
|
$this->be($this->user());
|
|
$this->call('get', route('transactions.convert.index', ['transfer', 672]));
|
|
$this->assertResponseStatus(200);
|
|
$this->see('Convert a withdrawal into a transfer');
|
|
}
|
|
|
|
/**
|
|
* @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::postIndex
|
|
*/
|
|
public function testPostIndex()
|
|
{
|
|
//
|
|
$this->be($this->user());
|
|
$this->call('post', route('transactions.convert.index', ['transfer', 672]));
|
|
$this->assertResponseStatus(302);
|
|
$this->assertRedirectedToRoute('transactions.show', [672]);
|
|
}
|
|
}
|