do not allow to stop already stopped timesheets (#289)

This commit is contained in:
Kevin Papst
2018-09-01 13:00:30 +02:00
committed by GitHub
parent b1546c0568
commit 62f91f4d38
15 changed files with 294 additions and 68 deletions

View File

@@ -0,0 +1,58 @@
<?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\Repository;
use App\Tests\KernelTestTrait;
use Doctrine\ORM\EntityManager;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
/**
* A base test class for AbstractRepository implementations.
*/
abstract class AbstractRepositoryTest extends KernelTestCase
{
use KernelTestTrait;
/**
* @var EntityManager
*/
private $entityManager;
/**
* {@inheritdoc}
*/
protected function setUp()
{
$kernel = self::bootKernel();
$this->entityManager = $kernel->getContainer()
->get('doctrine')
->getManager();
}
/**
* @return EntityManager
*/
protected function getEntityManager()
{
return $this->entityManager;
}
/**
* {@inheritdoc}
*/
protected function tearDown()
{
parent::tearDown();
$this->entityManager->close();
$this->entityManager = null; // avoid memory leaks
}
}