Files
firefly-iii/tests/acceptance/Controllers/TransactionControllerTest.php
2016-12-19 20:21:14 +01:00

90 lines
2.3 KiB
PHP

<?php
/**
* TransactionControllerTest.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.
*/
/**
* Generated by PHPUnit_SkeletonGenerator on 2016-12-10 at 05:51:44.
*/
class TransactionControllerTest 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\TransactionController::index
*/
public function testIndex()
{
$this->be($this->user());
$this->call('get', route('transactions.index', ['transfer']));
$this->assertResponseStatus(200);
// has bread crumb
$this->see('<ol class="breadcrumb">');
}
/**
* @covers \FireflyIII\Http\Controllers\TransactionController::indexAll
*/
public function testIndexAll()
{
$this->be($this->user());
$this->call('get', route('transactions.index.all', ['transfer']));
$this->assertResponseStatus(200);
// has bread crumb
$this->see('<ol class="breadcrumb">');
}
/**
* @covers \FireflyIII\Http\Controllers\TransactionController::indexByDate
*/
public function testIndexByDate()
{
$this->be($this->user());
$this->call('get', route('transactions.index.date', ['transfer', '2016-01-01']));
$this->assertResponseStatus(200);
// has bread crumb
$this->see('<ol class="breadcrumb">');
}
/**
* @covers \FireflyIII\Http\Controllers\TransactionController::reorder
*/
public function testReorder()
{
$data = [
'items' => [],
];
$this->be($this->user());
$this->call('post', route('transactions.reorder'), $data);
$this->assertResponseStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\TransactionController::show
*/
public function testShow()
{
$this->be($this->user());
$this->call('get', route('transactions.show', [1]));
$this->assertResponseStatus(200);
$this->see('<ol class="breadcrumb">');
}
}