php_components_pack/tests/classes/ClassMapperTest.php
babaev-an 3e199fc460 20250615
* Исправлена ошибка Class "GetOnly" not found.
2025-06-15 15:53:22 +03:00

33 lines
858 B
PHP

<?php
namespace goodboyalex\php_components_pack\tests\classes;
use goodboyalex\php_components_pack\classes\ClassMapper;
use goodboyalex\php_components_pack\tests\data\A;
use goodboyalex\php_components_pack\tests\data\B;
use PHPUnit\Framework\TestCase;
class ClassMapperTest extends TestCase
{
public function testMapClass ()
{
$this->PrepareForTest();
$a = new A('a', 2, true);
$b = new B();
ClassMapper::MapClass($a, $b);
$this->assertEquals('a', $b->a);
$this->assertEquals(2, $b->b);
}
private function PrepareForTest (): void
{
require_once __DIR__ . '/../data/A.php';
require_once __DIR__ . '/../data/B.php';
require_once __DIR__ . '/../../sources/attributes/GetOnly.php';
require_once __DIR__ . '/../../sources/classes/classMapper.php';
}
}