27 lines
576 B
PHP
27 lines
576 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Tests\Entity;
|
|
|
|
use App\Entity\User;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class UserTest extends TestCase
|
|
{
|
|
public function testHotelCodeMatching(): void
|
|
{
|
|
$user = new User();
|
|
$user->setHotelCodes(['ABC', 'DEF', 'GHI']);
|
|
|
|
$isMatch = $user->hasHotelCodeMatch('ABCXXX');
|
|
$this->assertTrue($isMatch);
|
|
|
|
$isMatch = $user->hasHotelCodeMatch('XXXGHI');
|
|
$this->assertTrue($isMatch);
|
|
|
|
$isMatch = $user->hasHotelCodeMatch('XXDEFXX');
|
|
$this->assertFalse($isMatch);
|
|
}
|
|
}
|