Files
kimai2/tests/Mocks/Security/UserDateTimeFactoryFactory.php
2019-08-16 01:22:33 +02:00

26 lines
680 B
PHP

<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Tests\Mocks\Security;
use App\Entity\User;
use App\Tests\Mocks\AbstractMockFactory;
use App\Timesheet\UserDateTimeFactory;
class UserDateTimeFactoryFactory extends AbstractMockFactory
{
public function create(?string $timezone = null): UserDateTimeFactory
{
$userFactory = new CurrentUserFactory($this->getTestCase());
$currentUser = $userFactory->create(new User(), $timezone);
return new UserDateTimeFactory($currentUser);
}
}