refactored page actions to event subscriber (#2420)
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
<?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\Twig\Runtime;
|
||||
|
||||
use App\Export\ServiceExport;
|
||||
use App\Twig\Runtime\ExporterExtension;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Twig\Runtime\ExporterExtension
|
||||
*/
|
||||
class ExporterExtensionTest extends TestCase
|
||||
{
|
||||
protected function getSut(): ExporterExtension
|
||||
{
|
||||
$service = new ServiceExport();
|
||||
|
||||
return new ExporterExtension($service);
|
||||
}
|
||||
|
||||
public function testGetExporter()
|
||||
{
|
||||
$sut = $this->getSut();
|
||||
self::assertEquals([], $sut->getTimesheetExporter());
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
<?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\Twig\Runtime;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Reporting\ReportingService;
|
||||
use App\Twig\Runtime\ReportingExtension;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
|
||||
/**
|
||||
* @covers \App\Twig\Runtime\ReportingExtension
|
||||
*/
|
||||
class ReportingExtensionTest extends TestCase
|
||||
{
|
||||
protected function getSut(bool $isGranted): ReportingExtension
|
||||
{
|
||||
$eventDispatcher = new EventDispatcher();
|
||||
|
||||
$authorization = $this->createMock(AuthorizationCheckerInterface::class);
|
||||
$authorization->expects($this->any())->method('isGranted')->willReturn($isGranted);
|
||||
|
||||
$service = new ReportingService($eventDispatcher, $authorization);
|
||||
|
||||
return new ReportingExtension($service);
|
||||
}
|
||||
|
||||
public function testRenderWidgetForInvalidValue()
|
||||
{
|
||||
$sut = $this->getSut(true);
|
||||
$reports = $sut->getAvailableReports(new User());
|
||||
|
||||
$this->assertCount(4, $reports);
|
||||
}
|
||||
}
|
||||
@@ -41,11 +41,9 @@ class RuntimeExtensionsTest extends TestCase
|
||||
'trigger',
|
||||
'actions',
|
||||
'javascript_translations',
|
||||
'timesheet_exporter',
|
||||
'active_timesheets',
|
||||
'encore_entry_css_source',
|
||||
'render_widget',
|
||||
'available_reports'
|
||||
];
|
||||
|
||||
$i = 0;
|
||||
|
||||
Reference in New Issue
Block a user