Commit 94b99a0f authored by Jens Segers's avatar Jens Segers

Adding user auth interfaces to tests, see issue #37

parent ac1bd369
......@@ -16,7 +16,8 @@
"illuminate/events": "4.0.x"
},
"require-dev": {
"illuminate/cache": "4.0.x"
"illuminate/cache": "4.0.x",
"illuminate/auth": "4.0.x"
},
"autoload": {
"psr-0": {
......
......@@ -25,15 +25,12 @@ $app['events'] = new Dispatcher;
# Cache driver
$app['cache'] = new Repository(new ArrayStore);
# Database configuration
$app['config']['database.fetch'] = null;
$app['config']['database.default'] = 'mongodb';
$app['config']['database.connections']['mongodb'] = array(
'name' => 'mongodb',
'driver' => 'mongodb',
'host' => 'localhost',
'database' => 'unittest'
);
# Load database configuration
$config = require 'config/database.php';
foreach ($config as $key => $value)
{
$app['config']["database.$key"] = $value;
}
# Initialize database manager
$app['db.factory'] = new ConnectionFactory(new Container);
......
<?php
return array(
'fetch' => PDO::FETCH_CLASS,
'default' => 'mongodb',
'connections' => array(
'mongodb' => array(
'name' => 'mongodb',
'driver' => 'mongodb',
'host' => 'localhost',
'database' => 'unittest',
),
)
);
......@@ -2,7 +2,10 @@
use Jenssegers\Mongodb\Model as Eloquent;
class User extends Eloquent {
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableInterface;
class User extends Eloquent implements UserInterface, RemindableInterface {
protected $collection = 'users';
......@@ -23,4 +26,34 @@ class User extends Eloquent {
return $this->hasOne('Role');
}
/**
* Get the unique identifier for the user.
*
* @return mixed
*/
public function getAuthIdentifier()
{
return $this->getKey();
}
/**
* Get the password for the user.
*
* @return string
*/
public function getAuthPassword()
{
return $this->password;
}
/**
* Get the e-mail address where password reminders are sent.
*
* @return string
*/
public function getReminderEmail()
{
return $this->email;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment