mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 14:07:25 +01:00
Optimized unit tests and entity implementation
This commit is contained in:
parent
aab188688c
commit
9a3801152f
@ -33,7 +33,7 @@ class FullPersonNameSource extends AbstractCombinationSource implements FullPers
|
|||||||
*
|
*
|
||||||
* @var FirstNameSourceInterface
|
* @var FirstNameSourceInterface
|
||||||
*/
|
*/
|
||||||
protected $firstnNameSource;
|
protected $firstNameSource;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,9 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kevinfrantz
|
* @author kevinfrantz
|
||||||
|
*
|
||||||
* @todo Change to SINGLE_TABLE. JOINED was necessary because SINGLE_TABLE leaded to:
|
* @todo Change to SINGLE_TABLE. JOINED was necessary because SINGLE_TABLE leaded to:
|
||||||
|
*
|
||||||
* @see << SQLSTATE[42S02]: Base table or view not found: 1146 Table 'DEV_DATABASE.source_data_name' doesn't exist >>
|
* @see << SQLSTATE[42S02]: Base table or view not found: 1146 Table 'DEV_DATABASE.source_data_name' doesn't exist >>
|
||||||
* @ORM\Entity
|
* @ORM\Entity
|
||||||
* @ORM\Table(name="source_data_name")
|
* @ORM\Table(name="source_data_name")
|
||||||
|
@ -7,6 +7,7 @@ use Doctrine\ORM\EntityManager;
|
|||||||
use App\Repository\UserRepository;
|
use App\Repository\UserRepository;
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use App\Entity\UserInterface;
|
use App\Entity\UserInterface;
|
||||||
|
use App\Entity\Source\Combination\PersonIdentitySourceInterface;
|
||||||
|
|
||||||
class UserRepositoryTest extends KernelTestCase
|
class UserRepositoryTest extends KernelTestCase
|
||||||
{
|
{
|
||||||
@ -42,6 +43,12 @@ class UserRepositoryTest extends KernelTestCase
|
|||||||
$user->setUsername('Karl Marx');
|
$user->setUsername('Karl Marx');
|
||||||
$user->setEmail('mew21@test.de');
|
$user->setEmail('mew21@test.de');
|
||||||
$user->setPassword('Friedrich ist kein Engel!:)');
|
$user->setPassword('Friedrich ist kein Engel!:)');
|
||||||
|
/**
|
||||||
|
* @var PersonIdentitySourceInterface
|
||||||
|
*/
|
||||||
|
$personIdentity = $user->getSource()->getPersonIdentitySource();
|
||||||
|
$personIdentity->getFullPersonNameSource()->getFirstNameSource()->setName('Karl');
|
||||||
|
$personIdentity->getFullPersonNameSource()->getSurnameSource()->setName('Marx');
|
||||||
$this->entityManager->persist($user);
|
$this->entityManager->persist($user);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
$userId = $user->getId();
|
$userId = $user->getId();
|
||||||
|
Loading…
Reference in New Issue
Block a user