diff --git a/composer.json b/composer.json index 5d58c01a0..bed8799a1 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/tests/app.php b/tests/app.php index 761f5507c..76741c8ea 100644 --- a/tests/app.php +++ b/tests/app.php @@ -25,15 +25,12 @@ function bound() {} # 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); diff --git a/tests/config/database.php b/tests/config/database.php new file mode 100644 index 000000000..08d8fc1fb --- /dev/null +++ b/tests/config/database.php @@ -0,0 +1,17 @@ + PDO::FETCH_CLASS, + 'default' => 'mongodb', + + 'connections' => array( + 'mongodb' => array( + 'name' => 'mongodb', + 'driver' => 'mongodb', + 'host' => 'localhost', + 'database' => 'unittest', + ), + ) + +); diff --git a/tests/models/User.php b/tests/models/User.php index 410bdd805..022df5427 100644 --- a/tests/models/User.php +++ b/tests/models/User.php @@ -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 @@ public function 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