mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-19 16:10:00 +00:00
Remove tests.
This commit is contained in:
@@ -1,157 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* TransactionControllerTest.php
|
||||
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
||||
*
|
||||
* This software may be modified and distributed under the terms
|
||||
* of the MIT license. See the LICENSE file for details.
|
||||
*/
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
|
||||
/**
|
||||
* Generated by PHPUnit_SkeletonGenerator on 2016-01-19 at 15:39:29.
|
||||
*/
|
||||
class TransactionControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::create
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::__construct
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/transactions/create/withdrawal');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::delete
|
||||
*/
|
||||
public function testDelete()
|
||||
{
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/transaction/delete/1');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::destroy
|
||||
*/
|
||||
public function testDestroy()
|
||||
{
|
||||
$this->session(['transactions.delete.url' => 'http://localhost']);
|
||||
|
||||
$this->be($this->user());
|
||||
$this->call('POST', '/transaction/destroy/1');
|
||||
$this->assertResponseStatus(302);
|
||||
$this->assertSessionHas('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::edit
|
||||
*/
|
||||
public function testEdit()
|
||||
{
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/transaction/edit/1');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::index
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param $range
|
||||
*/
|
||||
public function testIndex($range)
|
||||
{
|
||||
$journals = $this->mock('FireflyIII\Repositories\Journal\JournalRepositoryInterface');
|
||||
$journals->shouldReceive('getJournals')->once()->andReturn(new LengthAwarePaginator([], 0, 50));
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$this->call('GET', '/transactions/deposit');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::reorder
|
||||
*/
|
||||
public function testReorder()
|
||||
{
|
||||
$args = [
|
||||
'ids' => [1],
|
||||
'date' => '2015-01-01',
|
||||
];
|
||||
$this->be($this->user());
|
||||
$this->call('POST', '/transaction/reorder', $args);
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::show
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param $range
|
||||
*/
|
||||
public function testShow($range)
|
||||
{
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$this->call('GET', '/transaction/show/1');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::store
|
||||
* @covers FireflyIII\Http\Requests\JournalFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\JournalFormRequest::rules
|
||||
* @covers FireflyIII\Http\Requests\JournalFormRequest::getJournalData
|
||||
*/
|
||||
public function testStore()
|
||||
{
|
||||
$this->session(['transactions.create.url' => 'http://localhost']);
|
||||
|
||||
$args = [
|
||||
'what' => 'withdrawal',
|
||||
'description' => 'Something',
|
||||
'source_account_id' => '1',
|
||||
'destination_account_name' => 'Some expense',
|
||||
'amount' => 100,
|
||||
'amount_currency_id_amount' => 1,
|
||||
'date' => '2015-01-01',
|
||||
];
|
||||
$this->be($this->user());
|
||||
$this->call('POST', '/transactions/store/withdrawal', $args);
|
||||
$this->assertResponseStatus(302);
|
||||
$this->assertSessionHas('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::update
|
||||
* @covers FireflyIII\Http\Requests\JournalFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\JournalFormRequest::rules
|
||||
* @covers FireflyIII\Http\Requests\JournalFormRequest::getJournalData
|
||||
*/
|
||||
public function testUpdate()
|
||||
{
|
||||
$this->session(['transactions.edit.url' => 'http://localhost']);
|
||||
|
||||
$args = [
|
||||
'what' => 'withdrawal',
|
||||
'id' => 4,
|
||||
'description' => 'Something new',
|
||||
'source_account_id' => '1',
|
||||
'destination_account_name' => 'Some expense account',
|
||||
'amount' => 100,
|
||||
'amount_currency_id_amount' => 1,
|
||||
'date' => '2015-01-01',
|
||||
];
|
||||
$this->be($this->user());
|
||||
$this->call('POST', '/transaction/update/4', $args);
|
||||
$this->assertResponseStatus(302);
|
||||
$this->assertSessionHas('success');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user