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 @@ ...@@ -16,7 +16,8 @@
"illuminate/events": "4.0.x" "illuminate/events": "4.0.x"
}, },
"require-dev": { "require-dev": {
"illuminate/cache": "4.0.x" "illuminate/cache": "4.0.x",
"illuminate/auth": "4.0.x"
}, },
"autoload": { "autoload": {
"psr-0": { "psr-0": {
......
...@@ -25,15 +25,12 @@ $app['events'] = new Dispatcher; ...@@ -25,15 +25,12 @@ $app['events'] = new Dispatcher;
# Cache driver # Cache driver
$app['cache'] = new Repository(new ArrayStore); $app['cache'] = new Repository(new ArrayStore);
# Database configuration # Load database configuration
$app['config']['database.fetch'] = null; $config = require 'config/database.php';
$app['config']['database.default'] = 'mongodb'; foreach ($config as $key => $value)
$app['config']['database.connections']['mongodb'] = array( {
'name' => 'mongodb', $app['config']["database.$key"] = $value;
'driver' => 'mongodb', }
'host' => 'localhost',
'database' => 'unittest'
);
# Initialize database manager # Initialize database manager
$app['db.factory'] = new ConnectionFactory(new Container); $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 @@ ...@@ -2,7 +2,10 @@
use Jenssegers\Mongodb\Model as Eloquent; 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'; protected $collection = 'users';
...@@ -23,4 +26,34 @@ class User extends Eloquent { ...@@ -23,4 +26,34 @@ class User extends Eloquent {
return $this->hasOne('Role'); 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