Release 2.45 (#5721)
Co-authored-by: Henning Klein <info@henningklein.de>
This commit is contained in:
29
tests/Event/AbstractTeamEventTestCase.php
Normal file
29
tests/Event/AbstractTeamEventTestCase.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?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\Team;
|
||||
use App\Event\AbstractTeamEvent;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
abstract class AbstractTeamEventTestCase extends TestCase
|
||||
{
|
||||
abstract protected function createTeamEvent(Team $team): AbstractTeamEvent;
|
||||
|
||||
public function testGetterAndSetter(): void
|
||||
{
|
||||
$team = new Team('foo');
|
||||
$sut = $this->createTeamEvent($team);
|
||||
|
||||
self::assertInstanceOf(Event::class, $sut);
|
||||
self::assertSame($team, $sut->getTeam());
|
||||
}
|
||||
}
|
||||
25
tests/Event/TeamCreateEventTest.php
Normal file
25
tests/Event/TeamCreateEventTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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\Team;
|
||||
use App\Event\AbstractTeamEvent;
|
||||
use App\Event\TeamCreateEvent;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
#[CoversClass(AbstractTeamEventTestCase::class)]
|
||||
#[CoversClass(TeamCreateEvent::class)]
|
||||
class TeamCreateEventTest extends AbstractTeamEventTestCase
|
||||
{
|
||||
protected function createTeamEvent(Team $team): AbstractTeamEvent
|
||||
{
|
||||
return new TeamCreateEvent($team);
|
||||
}
|
||||
}
|
||||
25
tests/Event/TeamCreatePostEventTest.php
Normal file
25
tests/Event/TeamCreatePostEventTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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\Team;
|
||||
use App\Event\AbstractTeamEvent;
|
||||
use App\Event\TeamCreatePostEvent;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
#[CoversClass(AbstractTeamEventTestCase::class)]
|
||||
#[CoversClass(TeamCreatePostEvent::class)]
|
||||
class TeamCreatePostEventTest extends AbstractTeamEventTestCase
|
||||
{
|
||||
protected function createTeamEvent(Team $team): AbstractTeamEvent
|
||||
{
|
||||
return new TeamCreatePostEvent($team);
|
||||
}
|
||||
}
|
||||
25
tests/Event/TeamCreatePreEventTest.php
Normal file
25
tests/Event/TeamCreatePreEventTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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\Team;
|
||||
use App\Event\AbstractTeamEvent;
|
||||
use App\Event\TeamCreatePreEvent;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
#[CoversClass(AbstractTeamEventTestCase::class)]
|
||||
#[CoversClass(TeamCreatePreEvent::class)]
|
||||
class TeamCreatePreEventTest extends AbstractTeamEventTestCase
|
||||
{
|
||||
protected function createTeamEvent(Team $team): AbstractTeamEvent
|
||||
{
|
||||
return new TeamCreatePreEvent($team);
|
||||
}
|
||||
}
|
||||
25
tests/Event/TeamDeleteEventTest.php
Normal file
25
tests/Event/TeamDeleteEventTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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\Team;
|
||||
use App\Event\AbstractTeamEvent;
|
||||
use App\Event\TeamDeleteEvent;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
#[CoversClass(AbstractTeamEventTestCase::class)]
|
||||
#[CoversClass(TeamDeleteEvent::class)]
|
||||
class TeamDeleteEventTest extends AbstractTeamEventTestCase
|
||||
{
|
||||
protected function createTeamEvent(Team $team): AbstractTeamEvent
|
||||
{
|
||||
return new TeamDeleteEvent($team);
|
||||
}
|
||||
}
|
||||
25
tests/Event/TeamUpdatePostEventTest.php
Normal file
25
tests/Event/TeamUpdatePostEventTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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\Team;
|
||||
use App\Event\AbstractTeamEvent;
|
||||
use App\Event\TeamUpdatePostEvent;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
#[CoversClass(AbstractTeamEventTestCase::class)]
|
||||
#[CoversClass(TeamUpdatePostEvent::class)]
|
||||
class TeamUpdatePostEventTest extends AbstractTeamEventTestCase
|
||||
{
|
||||
protected function createTeamEvent(Team $team): AbstractTeamEvent
|
||||
{
|
||||
return new TeamUpdatePostEvent($team);
|
||||
}
|
||||
}
|
||||
25
tests/Event/TeamUpdatePreEventTest.php
Normal file
25
tests/Event/TeamUpdatePreEventTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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\Team;
|
||||
use App\Event\AbstractTeamEvent;
|
||||
use App\Event\TeamUpdatePreEvent;
|
||||
use PHPUnit\Framework\Attributes\CoversClass;
|
||||
|
||||
#[CoversClass(AbstractTeamEventTestCase::class)]
|
||||
#[CoversClass(TeamUpdatePreEvent::class)]
|
||||
class TeamUpdatePreEventTest extends AbstractTeamEventTestCase
|
||||
{
|
||||
protected function createTeamEvent(Team $team): AbstractTeamEvent
|
||||
{
|
||||
return new TeamUpdatePreEvent($team);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user