Finished user model, started account and others but we'll save those.

This commit is contained in:
James Cole
2014-07-03 11:11:21 +02:00
parent 3d1bc5891f
commit 35c90a32e9
2 changed files with 34 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
<?php
use \Illuminate\Database\Eloquent\Model as Eloquent;
class Elegant extends Eloquent
{
public static $rules = [];

View File

@@ -42,4 +42,37 @@ class UserTest extends TestCase
$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());
}
}