added database driven system configurations with admin screen (#647)

This commit is contained in:
Kevin Papst
2019-03-22 20:58:38 +01:00
committed by GitHub
parent e990ae4800
commit 13d9f8f3f7
142 changed files with 2262 additions and 64727 deletions

View File

@@ -9,6 +9,8 @@
namespace App\Tests\Validator\Constraints;
use App\Configuration\ConfigLoaderInterface;
use App\Configuration\TimesheetConfiguration;
use App\Entity\Activity;
use App\Entity\Customer;
use App\Entity\Project;
@@ -26,14 +28,18 @@ class TimesheetValidatorTest extends ConstraintValidatorTestCase
{
protected function createValidator($isGranted = true)
{
$options = [
'allow_future_times' => false
];
$authMock = $this->getMockBuilder(AuthorizationCheckerInterface::class)->getMock();
$authMock->method('isGranted')->willReturn($isGranted);
return new TimesheetValidator($authMock, $options, false);
$loader = $this->getMockBuilder(ConfigLoaderInterface::class)->getMock();
$config = new TimesheetConfiguration($loader, [
'rules' => [
'allow_future_times' => false,
],
'duration_only' => false,
]);
return new TimesheetValidator($authMock, $config);
}
/**