Refactor authentication system (#2602)
Make auth configuration available via UI, remove FOSUserBundle and SAML-Bundle dependency
This commit is contained in:
30
tests/Event/EmailEventTest.php
Normal file
30
tests/Event/EmailEventTest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Tests\Event;
|
||||
|
||||
use App\Event\EmailEvent;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Mime\Email;
|
||||
|
||||
/**
|
||||
* @covers \App\Event\EmailEvent
|
||||
*/
|
||||
class EmailEventTest extends TestCase
|
||||
{
|
||||
public function testGetter()
|
||||
{
|
||||
$email = new Email();
|
||||
$email->text('sdfsdfsdfsdf');
|
||||
|
||||
$sut = new EmailEvent($email);
|
||||
|
||||
$this->assertEquals($email, $sut->getEmail());
|
||||
}
|
||||
}
|
||||
37
tests/Event/EmailPasswordResetEventTest.php
Normal file
37
tests/Event/EmailPasswordResetEventTest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Tests\Event;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Event\EmailPasswordResetEvent;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Mime\Email;
|
||||
|
||||
/**
|
||||
* @covers \App\Event\EmailEvent
|
||||
* @covers \App\Event\UserEmailEvent
|
||||
* @covers \App\Event\EmailPasswordResetEvent
|
||||
*/
|
||||
class EmailPasswordResetEventTest extends TestCase
|
||||
{
|
||||
public function testGetter()
|
||||
{
|
||||
$user = new User();
|
||||
$user->setAlias('foo');
|
||||
|
||||
$email = new Email();
|
||||
$email->text('sdfsdfsdfsdf');
|
||||
|
||||
$sut = new EmailPasswordResetEvent($user, $email);
|
||||
|
||||
self::assertSame($email, $sut->getEmail());
|
||||
self::assertSame($user, $sut->getUser());
|
||||
}
|
||||
}
|
||||
37
tests/Event/EmailSelfRegistrationEventTest.php
Normal file
37
tests/Event/EmailSelfRegistrationEventTest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Tests\Event;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Event\EmailSelfRegistrationEvent;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Mime\Email;
|
||||
|
||||
/**
|
||||
* @covers \App\Event\EmailEvent
|
||||
* @covers \App\Event\UserEmailEvent
|
||||
* @covers \App\Event\EmailSelfRegistrationEvent
|
||||
*/
|
||||
class EmailSelfRegistrationEventTest extends TestCase
|
||||
{
|
||||
public function testGetter()
|
||||
{
|
||||
$user = new User();
|
||||
$user->setAlias('foo');
|
||||
|
||||
$email = new Email();
|
||||
$email->text('sdfsdfsdfsdf');
|
||||
|
||||
$sut = new EmailSelfRegistrationEvent($user, $email);
|
||||
|
||||
self::assertSame($email, $sut->getEmail());
|
||||
self::assertSame($user, $sut->getUser());
|
||||
}
|
||||
}
|
||||
31
tests/Event/UserCreateEventTest.php
Normal file
31
tests/Event/UserCreateEventTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Tests\Event;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Event\UserCreateEvent;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Event\AbstractUserEvent
|
||||
* @covers \App\Event\UserCreateEvent
|
||||
*/
|
||||
class UserCreateEventTest extends TestCase
|
||||
{
|
||||
public function testGetter()
|
||||
{
|
||||
$user = new User();
|
||||
$user->setAlias('foo');
|
||||
|
||||
$sut = new UserCreateEvent($user);
|
||||
|
||||
$this->assertEquals($user, $sut->getUser());
|
||||
}
|
||||
}
|
||||
31
tests/Event/UserCreatePostEventTest.php
Normal file
31
tests/Event/UserCreatePostEventTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Tests\Event;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Event\UserCreatePostEvent;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Event\AbstractUserEvent
|
||||
* @covers \App\Event\UserCreatePostEvent
|
||||
*/
|
||||
class UserCreatePostEventTest extends TestCase
|
||||
{
|
||||
public function testGetter()
|
||||
{
|
||||
$user = new User();
|
||||
$user->setAlias('foo');
|
||||
|
||||
$sut = new UserCreatePostEvent($user);
|
||||
|
||||
$this->assertEquals($user, $sut->getUser());
|
||||
}
|
||||
}
|
||||
31
tests/Event/UserCreatePreEventTest.php
Normal file
31
tests/Event/UserCreatePreEventTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Tests\Event;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Event\UserCreatePreEvent;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Event\AbstractUserEvent
|
||||
* @covers \App\Event\UserCreatePreEvent
|
||||
*/
|
||||
class UserCreatePreEventTest extends TestCase
|
||||
{
|
||||
public function testGetter()
|
||||
{
|
||||
$user = new User();
|
||||
$user->setAlias('foo');
|
||||
|
||||
$sut = new UserCreatePreEvent($user);
|
||||
|
||||
$this->assertEquals($user, $sut->getUser());
|
||||
}
|
||||
}
|
||||
31
tests/Event/UserInteractiveLoginEventTest.php
Normal file
31
tests/Event/UserInteractiveLoginEventTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Tests\Event;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Event\UserInteractiveLoginEvent;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Event\AbstractUserEvent
|
||||
* @covers \App\Event\UserInteractiveLoginEvent
|
||||
*/
|
||||
class UserInteractiveLoginEventTest extends TestCase
|
||||
{
|
||||
public function testGetter()
|
||||
{
|
||||
$user = new User();
|
||||
$user->setAlias('foo');
|
||||
|
||||
$sut = new UserInteractiveLoginEvent($user);
|
||||
|
||||
$this->assertEquals($user, $sut->getUser());
|
||||
}
|
||||
}
|
||||
31
tests/Event/UserUpdatePostEventTest.php
Normal file
31
tests/Event/UserUpdatePostEventTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Tests\Event;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Event\UserUpdatePostEvent;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Event\AbstractUserEvent
|
||||
* @covers \App\Event\UserUpdatePostEvent
|
||||
*/
|
||||
class UserUpdatePostEventTest extends TestCase
|
||||
{
|
||||
public function testGetter()
|
||||
{
|
||||
$user = new User();
|
||||
$user->setAlias('foo');
|
||||
|
||||
$sut = new UserUpdatePostEvent($user);
|
||||
|
||||
$this->assertEquals($user, $sut->getUser());
|
||||
}
|
||||
}
|
||||
31
tests/Event/UserUpdatePreEventTest.php
Normal file
31
tests/Event/UserUpdatePreEventTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Tests\Event;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Event\UserUpdatePreEvent;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Event\AbstractUserEvent
|
||||
* @covers \App\Event\UserUpdatePreEvent
|
||||
*/
|
||||
class UserUpdatePreEventTest extends TestCase
|
||||
{
|
||||
public function testGetter()
|
||||
{
|
||||
$user = new User();
|
||||
$user->setAlias('foo');
|
||||
|
||||
$sut = new UserUpdatePreEvent($user);
|
||||
|
||||
$this->assertEquals($user, $sut->getUser());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user