mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-11-04 03:07:58 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			42 lines
		
	
	
		
			944 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			944 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace Tests\Unit\Attribut;
 | 
						|
 | 
						|
use PHPUnit\Framework\TestCase;
 | 
						|
use App\Attribut\UserAttributInterface;
 | 
						|
use App\Attribut\UserAttribut;
 | 
						|
use App\Entity\UserInterface;
 | 
						|
 | 
						|
/**
 | 
						|
 * @author kevinfrantz
 | 
						|
 */
 | 
						|
class UserAttributTest extends TestCase
 | 
						|
{
 | 
						|
    /**
 | 
						|
     * @var UserAttributInterface
 | 
						|
     */
 | 
						|
    public $user;
 | 
						|
 | 
						|
    public function setUp(): void
 | 
						|
    {
 | 
						|
        $this->user = new class() implements UserAttributInterface {
 | 
						|
            use UserAttribut;
 | 
						|
        };
 | 
						|
    }
 | 
						|
 | 
						|
    public function testConstructor(): void
 | 
						|
    {
 | 
						|
        $this->assertFalse($this->user->hasUser());
 | 
						|
        $this->expectException(\TypeError::class);
 | 
						|
        $this->user->getUser();
 | 
						|
    }
 | 
						|
 | 
						|
    public function testAccessors(): void
 | 
						|
    {
 | 
						|
        $user = $this->createMock(UserInterface::class);
 | 
						|
        $this->assertNull($this->user->setUser($user));
 | 
						|
        $this->assertEquals($user, $this->user->getUser());
 | 
						|
        $this->assertTrue($this->user->hasUser());
 | 
						|
    }
 | 
						|
}
 |