Some attempts at code coverage and coveralls support.

This commit is contained in:
James Cole
2014-07-02 23:12:31 +02:00
parent e03e6e7290
commit 4540e93a63
8 changed files with 362 additions and 20 deletions

View File

@@ -9,10 +9,10 @@ class EloquentUserRepository implements UserRepositoryInterface
{
}
public function register()
public function register($array)
{
$user = new \User;
$user->email = \Input::get('email');
$user->email = $array['emai'];
$user->migrated = 0;
$user->verification = \Str::random(32);
$user->password = \Hash::make(\Str::random(12));
@@ -26,11 +26,11 @@ class EloquentUserRepository implements UserRepositoryInterface
return $user;
}
public function auth()
public function auth($array)
{
$user = \User::where('email', \Input::get('email'))->first();
$user = \User::where('email', $array['email'])->first();
if (!is_null($user)) {
if (\Hash::check(\Input::get('password'), $user->password)) {
if (\Hash::check($array['password'], $user->password)) {
}
}
return false;
@@ -45,6 +45,7 @@ class EloquentUserRepository implements UserRepositoryInterface
{
return \User::where('reset', $reset)->first();
}
public function findByEmail($email)
{
return \User::where('email', $email)->first();

View File

@@ -6,9 +6,9 @@ namespace Firefly\Storage\User;
interface UserRepositoryInterface
{
public function register();
public function register($array);
public function auth();
public function auth($array);
public function findByVerification($verification);
public function findByReset($reset);