Commit cd483dd0 authored by Jacob Priddy's avatar Jacob Priddy 👌

Revert saml things back to the way before it was disabled

parent a7f905f9
......@@ -78,21 +78,17 @@ class Authenticate implements AuthenticateUseCase
/**
* @inheritDoc
* @throws \Source\Exceptions\NotImplementedException
*/
public function handToSaml(array $options = []): string
{
// throw new NotImplementedException();
return $this->saml->login($options);
}
/**
* @inheritDoc
* @throws \Source\Exceptions\NotImplementedException
*/
public function handleSamlLogin(Presenter $presenter): void
{
// throw new NotImplementedException();
$samlUser = $this->saml->handleLogin();
if (!$samlUser) {
......@@ -139,11 +135,9 @@ class Authenticate implements AuthenticateUseCase
/**
* @inheritDoc
* @throws \Source\Exceptions\NotImplementedException
*/
public function samlLogout(?string $token): string
{
// throw new NotImplementedException();
if ($token) {
$this->tokens->invalidateToken($token);
}
......
......@@ -11,7 +11,7 @@ use Tests\Doubles\InMemoryUsersRepositoryStub;
use Source\UseCases\Users\Authenticate\Authenticate;
use Source\UseCases\Users\Authenticate\UserCreationException;
class SamlUseCaseTestNotUsed extends UseCaseBaseTest
class SamlUseCaseTest extends UseCaseBaseTest
{
protected const VALID_EMAIL = 'email';
......@@ -137,7 +137,7 @@ class SamlUseCaseTestNotUsed extends UseCaseBaseTest
{
$samlUser = $this->createSamlUser();
$users = new InMemoryUsersRepositoryStub();
$this->useCase = new Authenticate($users, $this->saml, $this->tokens);
$this->useCase = new Authenticate($users, $this->tokens, $this->saml);
$this->expectException(UserCreationException::class);
$this->handleLoginTest($samlUser);
}
......
......@@ -59,7 +59,7 @@ abstract class UseCaseBaseTest extends TestCase
$this->users = new InMemoryUsersRepository();
$this->tokens = new InMemoryTokensRepository();
$this->saml = new InMemorySamlRepository($this->loginUrl, $this->logoutUrl);
$this->useCase = new Authenticate($this->users, $this->tokens);
$this->useCase = new Authenticate($this->users, $this->tokens, $this->saml);
$this->presenter = new PresenterStub();
}
}
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