Files
firefly-iii/tests/controllers/AccountControllerTest.php
2015-04-03 08:31:50 +02:00

102 lines
2.4 KiB
PHP

<?php
use FireflyIII\Models\Preference;
use FireflyIII\Models\TransactionCurrency;
use League\FactoryMuffin\Facade as FactoryMuffin;
/**
* Generated by PHPUnit_SkeletonGenerator on 2015-03-08 at 20:05:14.
*/
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();
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
public function tearDown()
{
parent::tearDown();
}
public function testCreate()
{
$pref = FactoryMuffin::create('FireflyIII\Models\Preference');
$pref->data = '1M';
$this->be($pref->user);
// CURRENCY:
$currency = new TransactionCurrency;
Preferences::shouldReceive('get', 'viewRange')->andReturn($pref);
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
$this->call('GET', '/accounts/create/asset');
$this->assertResponseOk();
$this->assertViewHas('subTitle', 'Create a new asset account');
$this->assertViewHas('subTitleIcon', 'fa-money');
$this->assertViewHas('what', 'asset');
}
public function testDelete()
{
// fake an account.
$account = FactoryMuffin::create('FireflyIII\Models\Account');
$account->accountType->type = 'Asset account';
$account->accountType->save();
$this->be($account->user);
$this->call('GET', '/accounts/delete/' . $account->id);
$this->assertResponseOk();
$this->assertViewHas('subTitle', 'Delete ' . strtolower(e($account->accountType->type)) . ' "' . e($account->name) . '"');
}
public function testDestroy()
{
$this->markTestIncomplete();
}
public function testEdit()
{
$this->markTestIncomplete();
}
public function testIndex()
{
$this->markTestIncomplete();
}
public function testShow()
{
$this->markTestIncomplete();
}
public function testStore()
{
$this->markTestIncomplete();
}
public function testUpdate()
{
$this->markTestIncomplete();
}
}