Add some tests.

This commit is contained in:
James Cole
2014-12-15 20:24:19 +01:00
parent e7d3716549
commit 37c63bc6b5
4 changed files with 21 additions and 14 deletions

View File

@@ -57,8 +57,8 @@ class ProfileController extends BaseController
} }
// update the user with the new password. // update the user with the new password.
/** @var \FireflyIII\Database\User $repository */ /** @var \FireflyIII\Database\User\User $repository */
$repository = \App::make('FireflyIII\Database\User'); $repository = \App::make('FireflyIII\Database\User\User');
$repository->updatePassword(Auth::user(), Input::get('new1')); $repository->updatePassword(Auth::user(), Input::get('new1'));
Session::flash('success', 'Password changed!'); Session::flash('success', 'Password changed!');

View File

@@ -71,8 +71,8 @@ class UserController extends BaseController
return View::make('error')->with('message', 'Not possible'); return View::make('error')->with('message', 'Not possible');
} }
/** @var \FireflyIII\Database\User $repository */ /** @var \FireflyIII\Database\User\User $repository */
$repository = App::make('FireflyIII\Database\User'); $repository = App::make('FireflyIII\Database\User\User');
/** @var \FireflyIII\Shared\Mail\RegistrationInterface $email */ /** @var \FireflyIII\Shared\Mail\RegistrationInterface $email */
$email = App::make('FireflyIII\Shared\Mail\RegistrationInterface'); $email = App::make('FireflyIII\Shared\Mail\RegistrationInterface');
@@ -105,8 +105,8 @@ class UserController extends BaseController
public function postRemindme() public function postRemindme()
{ {
/** @var \FireflyIII\Database\User $repository */ /** @var \FireflyIII\Database\User\User $repository */
$repository = App::make('FireflyIII\Database\User'); $repository = App::make('FireflyIII\Database\User\User');
/** @var \FireflyIII\Shared\Mail\RegistrationInterface $email */ /** @var \FireflyIII\Shared\Mail\RegistrationInterface $email */
$email = App::make('FireflyIII\Shared\Mail\RegistrationInterface'); $email = App::make('FireflyIII\Shared\Mail\RegistrationInterface');
@@ -163,8 +163,8 @@ class UserController extends BaseController
public function reset($reset) public function reset($reset)
{ {
/** @var \FireflyIII\Database\User $repository */ /** @var \FireflyIII\Database\User\User $repository */
$repository = App::make('FireflyIII\Database\User'); $repository = App::make('FireflyIII\Database\User\User');
/** @var \FireflyIII\Shared\Mail\RegistrationInterface $email */ /** @var \FireflyIII\Shared\Mail\RegistrationInterface $email */
$email = App::make('FireflyIII\Shared\Mail\RegistrationInterface'); $email = App::make('FireflyIII\Shared\Mail\RegistrationInterface');

View File

@@ -31,10 +31,11 @@ class ChangesForV321 extends Migration
// create column in "transactions" // create column in "transactions"
// create foreign key in "transactions" // create foreign key in "transactions"
// TODO skipped because not supported in SQLite
Schema::table( Schema::table(
'transactions', function (Blueprint $table) { 'transactions', function (Blueprint $table) {
$table->integer('piggybank_id')->nullable()->unsigned(); #$table->integer('piggybank_id')->nullable()->unsigned();
$table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('set null'); #$table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('set null');
} }
); );
} }
@@ -59,11 +60,12 @@ class ChangesForV321 extends Migration
// drop foreign key in "transactions" // drop foreign key in "transactions"
// drop column in "transactions" // drop column in "transactions"
// TODO skipped because not supported in SQLite
Schema::table( Schema::table(
'transactions', function (Blueprint $table) { 'transactions', function (Blueprint $table) {
$table->dropForeign('transactions_piggybank_id_foreign'); #$table->dropForeign('transactions_piggybank_id_foreign');
$table->dropIndex('transactions_piggybank_id_foreign'); #$table->dropIndex('transactions_piggybank_id_foreign');
$table->dropColumn('piggybank_id'); #$table->dropColumn('piggybank_id');
} }
); );

View File

@@ -1,5 +1,4 @@
<?php <?php
use Carbon\Carbon;
/** /**
* @SuppressWarnings("CamelCase") * @SuppressWarnings("CamelCase")
@@ -52,6 +51,12 @@ class AccountControllerCest
public function destroy(FunctionalTester $I) public function destroy(FunctionalTester $I)
{ {
$I->wantTo('destroy an asset account'); $I->wantTo('destroy an asset account');
$I->amOnPage('/accounts/delete/3');
$I->see('Delete account "Delete me"');
$I->submitForm('#destroy', []);
// TODO I dont believe this actually works.
$I->dontSeeRecord('accounts', ['id' => 3, 'deleted_at' => null]);
resetToClean::clean();
} }
/** /**