/**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('zwacky/loginchecka', null, __DIR__ . '/..');
     // add config auth driver
     Loginchecka::extendConfigAuthDriver();
     include __DIR__ . '/filters.php';
     include __DIR__ . '/routes.php';
 }
예제 #2
0
 public function testCheckConfig()
 {
     $username = '******';
     $password = '******';
     $auth = $this->app['auth'];
     $testLogins = array(array('username' => $username, 'password' => $password, 'shouldReturn' => true), array('username' => '', 'password' => '', 'shouldReturn' => false), array('username' => $username, 'password' => $password . 'noise', 'shouldReturn' => false));
     Loginchecka::extendConfigAuthDriver();
     Config::set('auth.driver', 'config');
     Config::set(Loginchecka::$CONFIG_IDENTIFIER, 'username');
     Config::set(Loginchecka::$CONFIG_LOGINS, array(array('username' => $username, 'password' => $password)));
     foreach ($testLogins as $test) {
         $res = $auth->attempt(array('username' => $test['username'], 'password' => $test['password']));
         $this->assertEquals($res, $test['shouldReturn']);
     }
 }