use events for budget calculation (#2544)

This commit is contained in:
Kevin Papst
2021-04-29 11:50:48 +02:00
committed by GitHub
parent bb94b11e37
commit e4b176a4d5
30 changed files with 384 additions and 92 deletions

View File

@@ -11,7 +11,7 @@ namespace App\Tests\Export\Renderer;
use App\Export\Renderer\HtmlRenderer;
use App\Export\Renderer\HtmlRendererFactory;
use App\Repository\ProjectRepository;
use App\Project\ProjectStatisticService;
use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Twig\Environment;
@@ -26,7 +26,7 @@ class HtmlRendererFactoryTest extends TestCase
$sut = new HtmlRendererFactory(
$this->createMock(Environment::class),
$this->createMock(EventDispatcherInterface::class),
$this->createMock(ProjectRepository::class)
$this->createMock(ProjectStatisticService::class)
);
$renderer = $sut->create('foo', 'bar.html.twig');

View File

@@ -10,7 +10,7 @@
namespace App\Tests\Export\Renderer;
use App\Export\Renderer\HtmlRenderer;
use App\Repository\ProjectRepository;
use App\Project\ProjectStatisticService;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\Request;
use Twig\Environment;
@@ -28,7 +28,7 @@ class HtmlRendererTest extends AbstractRendererTest
$sut = new HtmlRenderer(
$this->createMock(Environment::class),
new EventDispatcher(),
$this->createMock(ProjectRepository::class)
$this->createMock(ProjectStatisticService::class)
);
$this->assertEquals('html', $sut->getId());
@@ -46,7 +46,7 @@ class HtmlRendererTest extends AbstractRendererTest
$request->setLocale('en');
$stack->push($request);
$sut = new HtmlRenderer($twig, new EventDispatcher(), $this->createMock(ProjectRepository::class));
$sut = new HtmlRenderer($twig, new EventDispatcher(), $this->createMock(ProjectStatisticService::class));
$response = $this->render($sut);

View File

@@ -11,7 +11,7 @@ namespace App\Tests\Export\Renderer;
use App\Export\Renderer\PDFRenderer;
use App\Export\Renderer\PdfRendererFactory;
use App\Repository\ProjectRepository;
use App\Project\ProjectStatisticService;
use App\Utils\HtmlToPdfConverter;
use PHPUnit\Framework\TestCase;
use Twig\Environment;
@@ -26,7 +26,7 @@ class PdfRendererFactoryTest extends TestCase
$sut = new PdfRendererFactory(
$this->createMock(Environment::class),
$this->createMock(HtmlToPdfConverter::class),
$this->createMock(ProjectRepository::class)
$this->createMock(ProjectStatisticService::class)
);
$renderer = $sut->create('foo', 'bar.pdf.twig');

View File

@@ -10,7 +10,7 @@
namespace App\Tests\Export\Renderer;
use App\Export\Renderer\PDFRenderer;
use App\Repository\ProjectRepository;
use App\Project\ProjectStatisticService;
use App\Utils\HtmlToPdfConverter;
use App\Utils\MPdfConverter;
use Symfony\Component\HttpFoundation\Request;
@@ -29,7 +29,7 @@ class PdfRendererTest extends AbstractRendererTest
$sut = new PDFRenderer(
$this->createMock(Environment::class),
$this->createMock(HtmlToPdfConverter::class),
$this->createMock(ProjectRepository::class)
$this->createMock(ProjectStatisticService::class)
);
$this->assertEquals('pdf', $sut->getId());
@@ -54,7 +54,7 @@ class PdfRendererTest extends AbstractRendererTest
$request->setLocale('en');
$stack->push($request);
$sut = new PDFRenderer($twig, $converter, $this->createMock(ProjectRepository::class));
$sut = new PDFRenderer($twig, $converter, $this->createMock(ProjectStatisticService::class));
$response = $this->render($sut);

View File

@@ -12,7 +12,7 @@ namespace App\Tests\Export;
use App\Export\Renderer\HtmlRenderer;
use App\Export\ServiceExport;
use App\Export\Timesheet\HtmlRenderer as HtmlExporter;
use App\Repository\ProjectRepository;
use App\Project\ProjectStatisticService;
use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Twig\Environment;
@@ -37,7 +37,7 @@ class ServiceExportTest extends TestCase
{
$sut = new ServiceExport();
$renderer = new HtmlRenderer($this->createMock(Environment::class), new EventDispatcher(), $this->createMock(ProjectRepository::class));
$renderer = new HtmlRenderer($this->createMock(Environment::class), new EventDispatcher(), $this->createMock(ProjectStatisticService::class));
$sut->addRenderer($renderer);
self::assertEquals(1, \count($sut->getRenderer()));
@@ -48,7 +48,7 @@ class ServiceExportTest extends TestCase
{
$sut = new ServiceExport();
$exporter = new HtmlExporter($this->createMock(Environment::class), new EventDispatcher(), $this->createMock(ProjectRepository::class));
$exporter = new HtmlExporter($this->createMock(Environment::class), new EventDispatcher(), $this->createMock(ProjectStatisticService::class));
$sut->addTimesheetExporter($exporter);
self::assertEquals(1, \count($sut->getTimesheetExporter()));

View File

@@ -10,7 +10,7 @@
namespace App\Tests\Export\Timesheet;
use App\Export\Timesheet\HtmlRenderer;
use App\Repository\ProjectRepository;
use App\Project\ProjectStatisticService;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\Request;
use Twig\Environment;
@@ -26,7 +26,7 @@ class HtmlRendererTest extends AbstractRendererTest
$sut = new HtmlRenderer(
$this->createMock(Environment::class),
new EventDispatcher(),
$this->createMock(ProjectRepository::class)
$this->createMock(ProjectStatisticService::class)
);
$this->assertEquals('print', $sut->getId());
@@ -42,7 +42,7 @@ class HtmlRendererTest extends AbstractRendererTest
$request->setLocale('en');
$stack->push($request);
$sut = new HtmlRenderer($twig, new EventDispatcher(), $this->createMock(ProjectRepository::class));
$sut = new HtmlRenderer($twig, new EventDispatcher(), $this->createMock(ProjectStatisticService::class));
$response = $this->render($sut);

View File

@@ -10,7 +10,7 @@
namespace App\Tests\Export\Timesheet;
use App\Export\Timesheet\PDFRenderer;
use App\Repository\ProjectRepository;
use App\Project\ProjectStatisticService;
use App\Utils\HtmlToPdfConverter;
use App\Utils\MPdfConverter;
use Symfony\Component\HttpFoundation\Request;
@@ -29,7 +29,7 @@ class PdfRendererTest extends AbstractRendererTest
$sut = new PDFRenderer(
$this->createMock(Environment::class),
$this->createMock(HtmlToPdfConverter::class),
$this->createMock(ProjectRepository::class)
$this->createMock(ProjectStatisticService::class)
);
$this->assertEquals('pdf', $sut->getId());
@@ -47,7 +47,7 @@ class PdfRendererTest extends AbstractRendererTest
$request->setLocale('en');
$stack->push($request);
$sut = new PDFRenderer($twig, $converter, $this->createMock(ProjectRepository::class));
$sut = new PDFRenderer($twig, $converter, $this->createMock(ProjectStatisticService::class));
$response = $this->render($sut);