mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-11-04 03:07:58 +00:00 
			
		
		
		
	Optimized unit tests and entity implementation
This commit is contained in:
		@@ -33,7 +33,7 @@ class FullPersonNameSource extends AbstractCombinationSource implements FullPers
 | 
			
		||||
     *
 | 
			
		||||
     * @var FirstNameSourceInterface
 | 
			
		||||
     */
 | 
			
		||||
    protected $firstnNameSource;
 | 
			
		||||
    protected $firstNameSource;
 | 
			
		||||
 | 
			
		||||
    public function __construct()
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,9 @@ use Symfony\Component\Validator\Constraints as Assert;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 *
 | 
			
		||||
 * @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 >>
 | 
			
		||||
 * @ORM\Entity
 | 
			
		||||
 * @ORM\Table(name="source_data_name")
 | 
			
		||||
 
 | 
			
		||||
@@ -7,6 +7,7 @@ use Doctrine\ORM\EntityManager;
 | 
			
		||||
use App\Repository\UserRepository;
 | 
			
		||||
use App\Entity\User;
 | 
			
		||||
use App\Entity\UserInterface;
 | 
			
		||||
use App\Entity\Source\Combination\PersonIdentitySourceInterface;
 | 
			
		||||
 | 
			
		||||
class UserRepositoryTest extends KernelTestCase
 | 
			
		||||
{
 | 
			
		||||
@@ -42,6 +43,12 @@ class UserRepositoryTest extends KernelTestCase
 | 
			
		||||
        $user->setUsername('Karl Marx');
 | 
			
		||||
        $user->setEmail('mew21@test.de');
 | 
			
		||||
        $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->flush();
 | 
			
		||||
        $userId = $user->getId();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user