refactored page actions to event subscriber (#2420)

This commit is contained in:
Kevin Papst
2021-03-15 14:18:44 +01:00
committed by GitHub
parent 9a2fd9ba91
commit e1c9af795c
117 changed files with 2403 additions and 815 deletions

View File

@@ -34,10 +34,10 @@ class UserPreferenceSubscriberTest extends TestCase
'theme.collapsed_sidebar',
'theme.update_browser_title',
'calendar.initial_view',
'reporting.initial_view',
'login.initial_view',
'timesheet.daily_stats',
'timesheet.export_decimal',
'reporting.initial_view',
'login.initial_view',
'timesheet.daily_stats',
'timesheet.export_decimal',
];
public function testGetSubscribedEvents()
@@ -67,6 +67,7 @@ class UserPreferenceSubscriberTest extends TestCase
switch ($pref->getName()) {
case UserPreference::HOURLY_RATE:
case UserPreference::INTERNAL_RATE:
case 'reporting.initial_view':
self::assertTrue($pref->isEnabled());
break;
@@ -97,6 +98,7 @@ class UserPreferenceSubscriberTest extends TestCase
switch ($pref->getName()) {
case UserPreference::HOURLY_RATE:
case UserPreference::INTERNAL_RATE:
case 'reporting.initial_view':
self::assertFalse($pref->isEnabled());
break;
@@ -109,7 +111,7 @@ class UserPreferenceSubscriberTest extends TestCase
protected function getSubscriber(bool $seeHourlyRate)
{
$authMock = $this->createMock(AuthorizationCheckerInterface::class);
$authMock->expects($this->once())->method('isGranted')->willReturn($seeHourlyRate);
$authMock->method('isGranted')->willReturn($seeHourlyRate);
$eventMock = $this->createMock(EventDispatcherInterface::class);
$formConfigMock = $this->createMock(SystemConfiguration::class);