Files
firefly-iii/tests/acceptance/Controllers/AccountControllerTest.php
2016-11-26 09:07:16 +01:00

138 lines
3.7 KiB
PHP

<?php
/**
* Generated by PHPUnit_SkeletonGenerator on 2016-11-20 at 07:15:07.
*/
class AccountControllerTest 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\AccountController::create
*/
public function testCreate()
{
$this->be($this->user());
$this->call('GET', route('accounts.create', ['asset']));
$this->assertResponseStatus(200);
}
/**
* @covers FireflyIII\Http\Controllers\AccountController::delete
*/
public function testDelete()
{
$this->be($this->user());
$this->call('GET', route('accounts.delete', [1]));
$this->assertResponseStatus(200);
}
/**
* @covers FireflyIII\Http\Controllers\AccountController::destroy
*/
public function testDestroy()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers FireflyIII\Http\Controllers\AccountController::edit
*/
public function testEdit()
{
$this->be($this->user());
$this->call('GET', route('accounts.edit', [1]));
$this->assertResponseStatus(200);
}
/**
* @covers FireflyIII\Http\Controllers\AccountController::index
* @dataProvider dateRangeProvider
*
* @param string $range
*/
public function testIndex(string $range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', route('accounts.index', ['asset']));
$this->assertResponseStatus(200);
}
/**
* @covers FireflyIII\Http\Controllers\AccountController::show
* @dataProvider dateRangeProvider
*
* @param string $range
*/
public function testShow(string $range)
{
$tasker = $this->mock(\FireflyIII\Repositories\Account\AccountTaskerInterface::class);
$tasker->shouldReceive('amountOutInPeriod')->withAnyArgs()->andReturn('-1');
$tasker->shouldReceive('amountInInPeriod')->withAnyArgs()->andReturn('1');
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', route('accounts.show', [1]));
$this->assertResponseStatus(200);
}
/**
* @covers FireflyIII\Http\Controllers\AccountController::showWithDate
* @dataProvider dateRangeProvider
*
* @param string $range
*/
public function testShowWithDate(string $range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', route('accounts.show.date', [1, '2016-01-01']));
$this->assertResponseStatus(200);
}
/**
* @covers FireflyIII\Http\Controllers\AccountController::store
*/
public function testStore()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers FireflyIII\Http\Controllers\AccountController::update
*/
public function testUpdate()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown()
{
}
}