edmondscommerce /
doctrine-static-meta
| 1 | <?php declare(strict_types=1); |
||
| 2 | |||
| 3 | namespace EdmondsCommerce\DoctrineStaticMeta\Entity\Traits; |
||
| 4 | |||
| 5 | use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder; |
||
| 6 | use PHPUnit\Framework\TestCase; |
||
| 7 | |||
| 8 | /** |
||
| 9 | * Class UsesPHPMetaDataTraitUnitTest |
||
| 10 | * |
||
| 11 | * @package EdmondsCommerce\DoctrineStaticMeta\Entity\Traits |
||
| 12 | * @SuppressWarnings(PHPMD.UnusedLocalVariable) |
||
| 13 | */ |
||
| 14 | class UsesPHPMetaDataTraitUnitTest extends TestCase |
||
| 15 | { |
||
| 16 | |||
| 17 | |||
| 18 | public function testGetGettersAndSetters(): void |
||
| 19 | { |
||
| 20 | $testClass = new class () |
||
| 21 | { |
||
| 22 | use UsesPHPMetaDataTrait; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 23 | |||
| 24 | public function __construct() |
||
| 25 | { |
||
| 26 | $this->runInitMethods(); |
||
| 27 | } |
||
| 28 | |||
| 29 | protected static function setCustomRepositoryClass(ClassMetadataBuilder $builder): void |
||
| 30 | { |
||
| 31 | // TODO: Implement setCustomRepositoryClass() method. |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getThis(): void |
||
| 35 | { |
||
| 36 | } |
||
| 37 | |||
| 38 | public function getThat(): void |
||
| 39 | { |
||
| 40 | } |
||
| 41 | |||
| 42 | public function setThis(): void |
||
| 43 | { |
||
| 44 | } |
||
| 45 | |||
| 46 | public function setThat(): void |
||
| 47 | { |
||
| 48 | } |
||
| 49 | |||
| 50 | private function getSomething(): void |
||
|
0 ignored issues
–
show
|
|||
| 51 | { |
||
| 52 | } |
||
| 53 | |||
| 54 | private function setSomething(): void |
||
|
0 ignored issues
–
show
|
|||
| 55 | { |
||
| 56 | } |
||
| 57 | |||
| 58 | protected function getSomethingElse(): void |
||
| 59 | { |
||
| 60 | } |
||
| 61 | |||
| 62 | protected function setSomethingElse(): void |
||
| 63 | { |
||
| 64 | } |
||
| 65 | }; |
||
| 66 | $expected = [ |
||
| 67 | 'getThis', |
||
| 68 | 'getThat', |
||
| 69 | ]; |
||
| 70 | $actual = $testClass->getGetters(); |
||
| 71 | self::assertSame($expected, $actual); |
||
| 72 | $expected = [ |
||
| 73 | 'setThis', |
||
| 74 | 'setThat', |
||
| 75 | ]; |
||
| 76 | $actual = $testClass->getSetters(); |
||
| 77 | self::assertSame($expected, $actual); |
||
| 78 | } |
||
| 79 | } |
||
| 80 |