Store sessions in database (#1736)
This commit is contained in:
39
tests/Command/CreateReleaseCommandTest.php
Normal file
39
tests/Command/CreateReleaseCommandTest.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?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\Command;
|
||||
|
||||
use App\Command\CreateReleaseCommand;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\CreateReleaseCommand
|
||||
* @group integration
|
||||
*/
|
||||
class CreateReleaseCommandTest extends KernelTestCase
|
||||
{
|
||||
/**
|
||||
* @var Application
|
||||
*/
|
||||
protected $application;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$kernel = self::bootKernel();
|
||||
$this->application = new Application($kernel);
|
||||
$this->application->add(new CreateReleaseCommand(realpath(__DIR__ . '/../../')));
|
||||
}
|
||||
|
||||
public function testCommandName()
|
||||
{
|
||||
$command = $this->application->find('kimai:create-release');
|
||||
self::assertInstanceOf(CreateReleaseCommand::class, $command);
|
||||
}
|
||||
}
|
||||
51
tests/Command/ImportCustomerCommandTest.php
Normal file
51
tests/Command/ImportCustomerCommandTest.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?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\Command;
|
||||
|
||||
use App\Command\ImportCustomerCommand;
|
||||
use App\Configuration\FormConfiguration;
|
||||
use App\Repository\CustomerRepository;
|
||||
use App\Repository\ProjectRepository;
|
||||
use App\Repository\TeamRepository;
|
||||
use App\Repository\UserRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\ImportCustomerCommand
|
||||
* @group integration
|
||||
*/
|
||||
class ImportCustomerCommandTest extends KernelTestCase
|
||||
{
|
||||
/**
|
||||
* @var Application
|
||||
*/
|
||||
protected $application;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$kernel = self::bootKernel();
|
||||
$this->application = new Application($kernel);
|
||||
|
||||
$customers = $this->createMock(CustomerRepository::class);
|
||||
$projects = $this->createMock(ProjectRepository::class);
|
||||
$teams = $this->createMock(TeamRepository::class);
|
||||
$users = $this->createMock(UserRepository::class);
|
||||
$configuration = $this->createMock(FormConfiguration::class);
|
||||
|
||||
$this->application->add(new ImportCustomerCommand($customers, $projects, $teams, $users, $configuration));
|
||||
}
|
||||
|
||||
public function testCommandName()
|
||||
{
|
||||
$command = $this->application->find('kimai:import:customer');
|
||||
self::assertInstanceOf(ImportCustomerCommand::class, $command);
|
||||
}
|
||||
}
|
||||
53
tests/Command/ImportTimesheetCommandTest.php
Normal file
53
tests/Command/ImportTimesheetCommandTest.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?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\Command;
|
||||
|
||||
use App\Command\ImportTimesheetCommand;
|
||||
use App\Configuration\FormConfiguration;
|
||||
use App\Repository\ActivityRepository;
|
||||
use App\Repository\CustomerRepository;
|
||||
use App\Repository\ProjectRepository;
|
||||
use App\Repository\TimesheetRepository;
|
||||
use App\Repository\UserRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\ImportTimesheetCommand
|
||||
* @group integration
|
||||
*/
|
||||
class ImportTimesheetCommandTest extends KernelTestCase
|
||||
{
|
||||
/**
|
||||
* @var Application
|
||||
*/
|
||||
protected $application;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$kernel = self::bootKernel();
|
||||
$this->application = new Application($kernel);
|
||||
|
||||
$customers = $this->createMock(CustomerRepository::class);
|
||||
$projects = $this->createMock(ProjectRepository::class);
|
||||
$activities = $this->createMock(ActivityRepository::class);
|
||||
$users = $this->createMock(UserRepository::class);
|
||||
$timesheets = $this->createMock(TimesheetRepository::class);
|
||||
$configuration = $this->createMock(FormConfiguration::class);
|
||||
|
||||
$this->application->add(new ImportTimesheetCommand($customers, $projects, $activities, $users, $timesheets, $configuration));
|
||||
}
|
||||
|
||||
public function testCommandName()
|
||||
{
|
||||
$command = $this->application->find('kimai:import:timesheet');
|
||||
self::assertInstanceOf(ImportTimesheetCommand::class, $command);
|
||||
}
|
||||
}
|
||||
47
tests/Command/KimaiImporterCommandTest.php
Normal file
47
tests/Command/KimaiImporterCommandTest.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?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\Command;
|
||||
|
||||
use App\Command\KimaiImporterCommand;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\KimaiImporterCommand
|
||||
* @group integration
|
||||
*/
|
||||
class KimaiImporterCommandTest extends KernelTestCase
|
||||
{
|
||||
/**
|
||||
* @var Application
|
||||
*/
|
||||
protected $application;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$kernel = self::bootKernel();
|
||||
$this->application = new Application($kernel);
|
||||
|
||||
$encoder = $this->createMock(UserPasswordEncoderInterface::class);
|
||||
$registry = $this->createMock(ManagerRegistry::class);
|
||||
$validator = $this->createMock(ValidatorInterface::class);
|
||||
|
||||
$this->application->add(new KimaiImporterCommand($encoder, $registry, $validator));
|
||||
}
|
||||
|
||||
public function testCommandName()
|
||||
{
|
||||
$command = $this->application->find('kimai:import-v1');
|
||||
self::assertInstanceOf(KimaiImporterCommand::class, $command);
|
||||
}
|
||||
}
|
||||
39
tests/Command/ReloadCommandTest.php
Normal file
39
tests/Command/ReloadCommandTest.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?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\Command;
|
||||
|
||||
use App\Command\ReloadCommand;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\ReloadCommand
|
||||
* @group integration
|
||||
*/
|
||||
class ReloadCommandTest extends KernelTestCase
|
||||
{
|
||||
/**
|
||||
* @var Application
|
||||
*/
|
||||
protected $application;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$kernel = self::bootKernel();
|
||||
$this->application = new Application($kernel);
|
||||
$this->application->add(new ReloadCommand());
|
||||
}
|
||||
|
||||
public function testCommandName()
|
||||
{
|
||||
$command = $this->application->find('kimai:reload');
|
||||
self::assertInstanceOf(ReloadCommand::class, $command);
|
||||
}
|
||||
}
|
||||
39
tests/Command/ResetCommandTest.php
Normal file
39
tests/Command/ResetCommandTest.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?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\Command;
|
||||
|
||||
use App\Command\ResetCommand;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Command\ResetCommand
|
||||
* @group integration
|
||||
*/
|
||||
class ResetCommandTest extends KernelTestCase
|
||||
{
|
||||
/**
|
||||
* @var Application
|
||||
*/
|
||||
protected $application;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$kernel = self::bootKernel();
|
||||
$this->application = new Application($kernel);
|
||||
$this->application->add(new ResetCommand());
|
||||
}
|
||||
|
||||
public function testCommandName()
|
||||
{
|
||||
$command = $this->application->find('kimai:reset-dev');
|
||||
self::assertInstanceOf(ResetCommand::class, $command);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user