mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Some new tests
This commit is contained in:
parent
c9358acf5d
commit
6157db0b6a
@ -37,7 +37,7 @@ class AccountController extends Controller
|
||||
*/
|
||||
public function create($what = 'asset')
|
||||
{
|
||||
$subTitleIcon = Config::get('firefly.subTitlesByIdentifier.' . $what);
|
||||
$subTitleIcon = Config::get('firefly.subIconsByIdentifier.' . $what);
|
||||
$subTitle = 'Create a new ' . e($what) . ' account';
|
||||
|
||||
return view('accounts.create', compact('subTitleIcon', 'what', 'subTitle'));
|
||||
|
@ -1,11 +1,9 @@
|
||||
<?php namespace FireflyIII\Http\Controllers;
|
||||
|
||||
use Cache;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use Input;
|
||||
use Preferences;
|
||||
use Redirect;
|
||||
use Session;
|
||||
|
||||
/**
|
||||
@ -16,13 +14,6 @@ use Session;
|
||||
class HomeController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function dateRange()
|
||||
{
|
||||
$start = new Carbon(Input::get('start'));
|
||||
@ -62,9 +53,7 @@ class HomeController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// var_dump($transactions);
|
||||
|
||||
return view('index', compact('count', 'title','savings', 'subTitle', 'mainTitleIcon', 'transactions'));
|
||||
return view('index', compact('count', 'title', 'savings', 'subTitle', 'mainTitleIcon', 'transactions'));
|
||||
}
|
||||
|
||||
|
||||
|
7
pu.sh
Normal file
7
pu.sh
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# create DB if not exists
|
||||
rm -f tests/database/db.sqlite
|
||||
touch tests/database/db.sqlite
|
||||
php artisan migrate --seed
|
||||
phpunit
|
76
tests/controllers/AccountControllerTest.php
Normal file
76
tests/controllers/AccountControllerTest.php
Normal file
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 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();
|
||||
$this->be(FireflyIII\User::whereEmail('thegrumpydictator@gmail.com')->first());
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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()
|
||||
{
|
||||
$response = $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()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
@ -34,7 +34,7 @@ class HomeControllerTest extends TestCase
|
||||
$start = '2014-03-01';
|
||||
$end = '2015-03-31';
|
||||
|
||||
$this->be(new FireflyIII\User);
|
||||
$this->be(FireflyIII\User::whereEmail('thegrumpydictator@gmail.com')->first());
|
||||
$this->call('POST', '/daterange', ['end' => $end, 'start' => $start,'_token' => 'replaceme']);
|
||||
$this->assertResponseOk();
|
||||
|
||||
@ -52,7 +52,7 @@ class HomeControllerTest extends TestCase
|
||||
$start = '2015-03-01';
|
||||
$end = '2015-03-31';
|
||||
|
||||
$this->be(new FireflyIII\User);
|
||||
$this->be(FireflyIII\User::whereEmail('thegrumpydictator@gmail.com')->first());
|
||||
$this->call('POST', '/daterange', ['end' => $end, 'start' => $start,'_token' => 'replaceme']);
|
||||
$this->assertResponseOk();
|
||||
|
||||
@ -66,7 +66,7 @@ class HomeControllerTest extends TestCase
|
||||
*/
|
||||
public function testIndexLoggedIn()
|
||||
{
|
||||
$this->be(new FireflyIII\User);
|
||||
$this->be(FireflyIII\User::whereEmail('thegrumpydictator@gmail.com')->first());
|
||||
$response = $this->call('GET', '/');
|
||||
$this->assertResponseOk();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user