Skip to content

Commit

Permalink
psr2
Browse files Browse the repository at this point in the history
  • Loading branch information
yuklia committed May 8, 2015
1 parent 05983a4 commit aaf0e5c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 41 deletions.
21 changes: 0 additions & 21 deletions application/configs/testing/db.php

This file was deleted.

7 changes: 4 additions & 3 deletions application/modules/auth/controllers/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,18 @@ function ($provider = '') {
/**
* @var Bootstrap $this
*/
try{
try {
$auth = new AuthProvider($provider);
$auth->setResponse($this);
$auth->setIdentity($this->user());
$auth->authProcess();
}catch (Exception $e) {
} catch (Exception $e) {
Messages::addError($e->getMessage());
}

return
function () {
return false;
};
};

};
4 changes: 1 addition & 3 deletions tests/models/Auth/AuthProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public function testUserStatusActive()
try {
$provider->alreadyRegisteredLogic($authRow);
} catch (RedirectException $e) {

}
$this->assertNotNull(Auth::getIdentity());

Expand Down Expand Up @@ -107,5 +106,4 @@ public function testAvailableProviders()
$provider = new AuthProvider('Facebook');
$this->assertContains("Facebook", $provider->getAvailableProviders());
}

}
}
34 changes: 20 additions & 14 deletions tests/modules/auth/controllers/AuthTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php

/**
* Created by PhpStorm.
* User: yuklia
* Date: 07.05.15
* Time: 11:37
* PHP version 5
*
* @category Testing
* @package Application\Tests\Auth
* @link https://github.com/bluzphp
* @created 08.05.15
*/

namespace Application\Tests\Auth;

use Application\Auth\AuthProvider;
Expand All @@ -15,7 +17,12 @@
use Bluz\Proxy\Db;
use Bluz\Proxy\Messages;

class AuthTest extends ControllerTestCase{
/**
* Class AuthTest
* @package Application\Tests\Auth
*/
class AuthTest extends ControllerTestCase
{

protected function setUp()
{
Expand Down Expand Up @@ -82,12 +89,12 @@ public function testUserAlreadyLinkedTo()
$provider->setAuthAdapter($authAdapterMock);
try {
$provider->authProcess();
} catch (RedirectException $red) {
} catch (\Exception $e) {
}
catch (RedirectException $red) {}
catch (\Exception $e) {}

$message = Messages::pop();
$this->assertEquals("You have already linked to Facebook", $message->text );
$this->assertEquals("You have already linked to Facebook", $message->text);

}

Expand Down Expand Up @@ -115,13 +122,12 @@ public function testUserNotLinkedTo()
$provider->setAuthAdapter($authAdapterMock);
try {
$provider->authProcess();
} catch (RedirectException $red) {
} catch (\Exception $e) {
}
catch (RedirectException $red) {}
catch (\Exception $e) {}

$message = Messages::pop();
$this->assertEquals("First you need to be linked to Facebook", $message->text );
$this->assertEquals("First you need to be linked to Facebook", $message->text);

}

}
}

0 comments on commit aaf0e5c

Please sign in to comment.