removed soft_limit setting (#2611)

This commit is contained in:
Kevin Papst
2021-06-10 16:01:09 +02:00
committed by GitHub
parent 0b519e9d08
commit 6709ef4c4c
39 changed files with 24 additions and 178 deletions

View File

@@ -117,7 +117,6 @@ class SystemConfigurationTest extends TestCase
(new Configuration())->setName('timesheet.markdown_content')->setValue('1'),
(new Configuration())->setName('timesheet.default_begin')->setValue('07:00'),
(new Configuration())->setName('timesheet.active_entries.hard_limit')->setValue('7'),
(new Configuration())->setName('timesheet.active_entries.soft_limit')->setValue('3'),
(new Configuration())->setName('theme.colors_limited')->setValue(false),
];
}
@@ -230,7 +229,7 @@ class SystemConfigurationTest extends TestCase
{
$sut = $this->getSut($this->getDefaultSettings(), []);
$this->assertEquals(99, $sut->getTimesheetActiveEntriesHardLimit());
$this->assertEquals(15, $sut->getTimesheetActiveEntriesSoftLimit());
$this->assertEquals(99, $sut->getTimesheetActiveEntriesSoftLimit());
$this->assertFalse($sut->isTimesheetAllowFutureTimes());
$this->assertFalse($sut->isTimesheetMarkdownEnabled());
$this->assertEquals('duration_only', $sut->getTimesheetTrackingMode());
@@ -254,7 +253,7 @@ class SystemConfigurationTest extends TestCase
{
$sut = $this->getSut($this->getDefaultSettings(), $this->getDefaultLoaderSettings());
$this->assertEquals(7, $sut->getTimesheetActiveEntriesHardLimit());
$this->assertEquals(3, $sut->getTimesheetActiveEntriesSoftLimit());
$this->assertEquals(7, $sut->getTimesheetActiveEntriesSoftLimit());
$this->assertTrue($sut->isTimesheetAllowFutureTimes());
$this->assertTrue($sut->isTimesheetMarkdownEnabled());
$this->assertEquals('default', $sut->getTimesheetTrackingMode());

View File

@@ -47,7 +47,6 @@ class TimesheetConfigurationTest extends TestCase
'markdown_content' => false,
'active_entries' => [
'hard_limit' => 99,
'soft_limit' => 15,
],
'default_begin' => 'now',
];
@@ -64,7 +63,6 @@ class TimesheetConfigurationTest extends TestCase
(new Configuration())->setName('timesheet.markdown_content')->setValue('1'),
(new Configuration())->setName('timesheet.default_begin')->setValue('07:00'),
(new Configuration())->setName('timesheet.active_entries.hard_limit')->setValue('7'),
(new Configuration())->setName('timesheet.active_entries.soft_limit')->setValue('3'),
];
}
@@ -79,7 +77,7 @@ class TimesheetConfigurationTest extends TestCase
$sut = $this->getSut($this->getDefaultSettings(), []);
$this->assertEquals(99, $sut->getActiveEntriesHardLimit());
$this->assertEquals(15, $sut->getActiveEntriesSoftLimit());
$this->assertEquals(99, $sut->getActiveEntriesSoftLimit());
$this->assertFalse($sut->isAllowFutureTimes());
$this->assertFalse($sut->isMarkdownEnabled());
$this->assertEquals('duration_only', $sut->getTrackingMode());
@@ -100,7 +98,7 @@ class TimesheetConfigurationTest extends TestCase
{
$sut = $this->getSut($this->getDefaultSettings(), $this->getDefaultLoaderSettings());
$this->assertEquals(7, $sut->getActiveEntriesHardLimit());
$this->assertEquals(3, $sut->getActiveEntriesSoftLimit());
$this->assertEquals(7, $sut->getActiveEntriesSoftLimit());
$this->assertTrue($sut->isAllowFutureTimes());
$this->assertTrue($sut->isMarkdownEnabled());
$this->assertEquals('default', $sut->getTrackingMode());

View File

@@ -93,7 +93,6 @@ class SystemConfigurationControllerTest extends ControllerBaseTest
$this->assertEquals('default', $configService->find('timesheet.mode'));
$this->assertTrue($configService->find('timesheet.rules.allow_future_times'));
$this->assertEquals(1, $configService->find('timesheet.active_entries.hard_limit'));
$this->assertEquals(1, $configService->find('timesheet.active_entries.soft_limit'));
$form = $client->getCrawler()->filter('form[name=system_configuration_form_timesheet]')->form();
$client->submit($form, [
@@ -105,7 +104,6 @@ class SystemConfigurationControllerTest extends ControllerBaseTest
['name' => 'timesheet.rules.allow_overlapping_records', 'value' => false],
['name' => 'timesheet.rules.allow_overbooking_budget', 'value' => false],
['name' => 'timesheet.active_entries.hard_limit', 'value' => 99],
['name' => 'timesheet.active_entries.soft_limit', 'value' => 77],
]
]
]);
@@ -120,7 +118,6 @@ class SystemConfigurationControllerTest extends ControllerBaseTest
$this->assertFalse($configService->find('timesheet.rules.allow_future_times'));
$this->assertFalse($configService->find('timesheet.rules.allow_overlapping_records'));
$this->assertEquals(99, $configService->find('timesheet.active_entries.hard_limit'));
$this->assertEquals(77, $configService->find('timesheet.active_entries.soft_limit'));
}
public function testUpdateLockdownPeriodConfig()
@@ -173,14 +170,12 @@ class SystemConfigurationControllerTest extends ControllerBaseTest
['name' => 'timesheet.rules.allow_overlapping_records', 'value' => 1],
['name' => 'timesheet.rules.allow_overbooking_budget', 'value' => 1],
['name' => 'timesheet.active_entries.hard_limit', 'value' => -1],
['name' => 'timesheet.active_entries.soft_limit', 'value' => -1],
]
]
],
[
'#system_configuration_form_timesheet_configuration_0_value', // mode
'#system_configuration_form_timesheet_configuration_5_value', // hard_limit
'#system_configuration_form_timesheet_configuration_6_value', // soft_limit
],
true
);

View File

@@ -376,7 +376,6 @@ class TimesheetControllerTest extends ControllerBaseTest
['name' => 'timesheet.rules.allow_overlapping_records', 'value' => false],
['name' => 'timesheet.rules.allow_overbooking_budget', 'value' => true],
['name' => 'timesheet.active_entries.hard_limit', 'value' => 1],
['name' => 'timesheet.active_entries.soft_limit', 'value' => 1],
]
]
]);

View File

@@ -9,6 +9,7 @@
namespace App\Tests\EventSubscriber;
use App\Configuration\MailConfiguration;
use App\Entity\User;
use App\Event\DashboardEvent;
use App\Event\EmailEvent;
@@ -20,6 +21,7 @@ use App\Repository\CustomerRepository;
use App\Repository\ProjectRepository;
use App\Repository\UserRepository;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Email;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
@@ -38,9 +40,14 @@ class EmailSubscriberTest extends TestCase
public function testSendIsTriggered()
{
$mailer = $this->createMock(KimaiMailer::class);
$mailer = $this->createMock(MailerInterface::class);
$mailer->expects($this->once())->method('send');
$mailer = new KimaiMailer(
new MailConfiguration('test@example.com'),
$mailer
);
$sut = new EmailSubscriber($mailer);
$event = new EmailEvent(new Email());