mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-02 12:15:55 +00:00
Made big headway in preference management, accounts, importing stuff, etc. etc.
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
class ExampleTest extends TestCase {
|
||||
|
||||
/**
|
||||
* A basic functional test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testBasicExample()
|
||||
{
|
||||
$crawler = $this->client->request('GET', '/login');
|
||||
|
||||
$this->assertTrue($this->client->getResponse()->isOk());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
class AccountControllerTest extends TestCase {
|
||||
|
||||
class AccountControllerTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
@@ -8,6 +10,7 @@ class AccountControllerTest extends TestCase {
|
||||
public function testCreate()
|
||||
{
|
||||
// mock:
|
||||
View::shouldReceive('share');
|
||||
View::shouldReceive('make')->with('accounts.create');
|
||||
|
||||
// call
|
||||
@@ -16,4 +19,11 @@ class AccountControllerTest extends TestCase {
|
||||
// test
|
||||
$this->assertResponseOk();
|
||||
}
|
||||
|
||||
public function testShow()
|
||||
{
|
||||
|
||||
// the route filters on accounts using Eloquent, maybe fix that instead?
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
}
|
||||
@@ -10,13 +10,25 @@ class HomeControllerTest extends TestCase
|
||||
public function testIndex()
|
||||
{
|
||||
// mock:
|
||||
View::shouldReceive('share');
|
||||
View::shouldReceive('make')->with('index')->once()->andReturn(\Mockery::self())
|
||||
->shouldReceive('with')->once() // Pass a 'with' parameter
|
||||
->with('count', 0)
|
||||
;
|
||||
->andReturn(Mockery::self())
|
||||
->shouldReceive('with')->once() // another 'with' parameter.
|
||||
->with('accounts',[])
|
||||
->andReturn(Mockery::self())
|
||||
;
|
||||
Auth::shouldReceive('check')->andReturn(true);
|
||||
|
||||
// mock account repository
|
||||
$accounts = $this->mock('Firefly\Storage\Account\AccountRepositoryInterface');
|
||||
$accounts->shouldReceive('count')->andReturn(0);
|
||||
$accounts->shouldReceive('getActiveDefault')->andReturn([]);
|
||||
|
||||
// mock preferences helper:
|
||||
$preferences = $this->mock('Firefly\Helper\Preferences\PreferencesHelperInterface');
|
||||
$preferences->shouldReceive('get')->with('frontpageAccounts',[])->andReturn(new \Preference)->once();
|
||||
|
||||
// call
|
||||
$this->call('GET', '/');
|
||||
|
||||
@@ -10,6 +10,7 @@ class MigrationControllerTest extends TestCase
|
||||
public function testIndex()
|
||||
{
|
||||
// mock:
|
||||
View::shouldReceive('share');
|
||||
View::shouldReceive('make')->with('migrate.index');
|
||||
|
||||
// call
|
||||
|
||||
@@ -6,6 +6,7 @@ class ProfileControllerTest extends TestCase
|
||||
public function testIndex()
|
||||
{
|
||||
// mock:
|
||||
View::shouldReceive('share');
|
||||
View::shouldReceive('make')->with('profile.index');
|
||||
|
||||
// call
|
||||
@@ -18,6 +19,7 @@ class ProfileControllerTest extends TestCase
|
||||
public function testChangePassword()
|
||||
{
|
||||
// mock:
|
||||
View::shouldReceive('share');
|
||||
View::shouldReceive('make')->with('profile.change-password');
|
||||
|
||||
// call
|
||||
|
||||
30
app/tests/models/TransactionJournalTest.php
Normal file
30
app/tests/models/TransactionJournalTest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
class TransactionJournalTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Default preparation for each test
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->prepareForTests();
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate the database
|
||||
*/
|
||||
private function prepareForTests()
|
||||
{
|
||||
Artisan::call('migrate');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test accounts
|
||||
*/
|
||||
public function testJournal()
|
||||
{
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
}
|
||||
@@ -68,11 +68,8 @@ class UserTest extends TestCase
|
||||
|
||||
$account->save();
|
||||
|
||||
|
||||
|
||||
$this->assertCount(1,$user->accounts()->get());
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user