mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-06 12:45:30 +00:00
Finished user model, started account and others but we'll save those.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use \Illuminate\Database\Eloquent\Model as Eloquent;
|
||||||
class Elegant extends Eloquent
|
class Elegant extends Eloquent
|
||||||
{
|
{
|
||||||
public static $rules = [];
|
public static $rules = [];
|
||||||
|
@@ -42,4 +42,37 @@ class UserTest extends TestCase
|
|||||||
$this->assertEquals($errors[0], "The email field is required.");
|
$this->assertEquals($errors[0], "The email field is required.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test accounts
|
||||||
|
*/
|
||||||
|
public function testUserAccounts()
|
||||||
|
{
|
||||||
|
// Create a new User
|
||||||
|
$user = new User;
|
||||||
|
$user->email = 'bla';
|
||||||
|
$user->password = 'bla';
|
||||||
|
$user->migrated = 0;
|
||||||
|
$user->save();
|
||||||
|
|
||||||
|
// account type:
|
||||||
|
$at = new AccountType;
|
||||||
|
$at->description = 'Bla';
|
||||||
|
$at->save();
|
||||||
|
|
||||||
|
|
||||||
|
$account = new Account;
|
||||||
|
$account->name = 'bla';
|
||||||
|
$account->active = 1;
|
||||||
|
$account->accountType()->associate($at);
|
||||||
|
$account->user()->associate($user);
|
||||||
|
|
||||||
|
$account->save();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$this->assertCount(1,$user->accounts()->get());
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user