support different formats in user timesheet exports (#1222)

This commit is contained in:
Kevin Papst
2019-11-08 16:10:38 +01:00
committed by GitHub
parent 0705c26513
commit fa1c79e15c
75 changed files with 1872 additions and 951 deletions

View File

@@ -29,7 +29,7 @@ class DailyWorkingTimeChartTest extends TestCase
{
public function createSut(): AbstractWidgetType
{
$repository = $this->getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->getMock();
$repository = $this->createMock(TimesheetRepository::class);
$mockFactory = new UserDateTimeFactoryFactory($this);
$userFactory = new CurrentUserFactory($this);
$user = $userFactory->create(new User(), 'Europe/Berlin');
@@ -100,7 +100,7 @@ class DailyWorkingTimeChartTest extends TestCase
public function testGetData()
{
$repository = $this->getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->setMethods(['getDailyData'])->getMock();
$repository = $this->getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->onlyMethods(['getDailyData'])->getMock();
$repository->expects($this->once())->method('getDailyData')->willReturnCallback(function ($user, $begin, $end) {
return [
['year' => '2019', 'month' => '1', 'day' => 1, 'rate' => 13.75, 'duration' => 1234]