Skip to content

Commit

Permalink
TASK: Move union-type tests into main suite as we only support php 8 …
Browse files Browse the repository at this point in the history
…nowadays
  • Loading branch information
mficzel committed Jan 23, 2025
1 parent c8fe09c commit d4bab72
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Neos\Flow\Tests\Functional\Reflection\Fixtures\PHP8;
namespace Neos\Flow\Tests\Functional\Reflection\Fixtures;

/*
* This file is part of the Neos.Flow package.
Expand Down
13 changes: 5 additions & 8 deletions Neos.Flow/Tests/Functional/Reflection/ReflectionServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
*/

use Neos\Flow\Reflection\ReflectionService;
use Neos\Flow\Tests\Functional\Persistence;
use Neos\Flow\Tests\Functional\Reflection;
use Neos\Flow\Tests\Functional\Reflection\Fixtures\Model\SubEntity;
use Neos\Flow\Tests\Functional\Reflection\Fixtures\Model\SubSubEntity;
use Neos\Flow\Tests\Functional\Reflection\Fixtures\Model\SubSubSubEntity;
use Neos\Flow\Tests\FunctionalTestCase;
use Neos\Flow\Tests\Functional\Reflection;
use Neos\Flow\Tests\Functional\Persistence;

/**
* Functional tests for the Reflection Service features
Expand Down Expand Up @@ -356,12 +356,9 @@ public function annotatedArrayTypeHintsWorkCorrectly()
*/
public function unionReturnTypesWorkCorrectly()
{
if (PHP_MAJOR_VERSION < 8) {
$this->markTestSkipped('Only for PHP 8 with UnionTypes');
}
$returnTypeA = $this->reflectionService->getMethodDeclaredReturnType(Reflection\Fixtures\PHP8\DummyClassWithUnionTypeHints::class, 'methodWithUnionReturnTypeA');
$returnTypeB = $this->reflectionService->getMethodDeclaredReturnType(Reflection\Fixtures\PHP8\DummyClassWithUnionTypeHints::class, 'methodWithUnionReturnTypesB');
$returnTypeC = $this->reflectionService->getMethodDeclaredReturnType(Reflection\Fixtures\PHP8\DummyClassWithUnionTypeHints::class, 'methodWithUnionReturnTypesC');
$returnTypeA = $this->reflectionService->getMethodDeclaredReturnType(Fixtures\DummyClassWithUnionTypeHints::class, 'methodWithUnionReturnTypeA');
$returnTypeB = $this->reflectionService->getMethodDeclaredReturnType(Fixtures\DummyClassWithUnionTypeHints::class, 'methodWithUnionReturnTypesB');
$returnTypeC = $this->reflectionService->getMethodDeclaredReturnType(Fixtures\DummyClassWithUnionTypeHints::class, 'methodWithUnionReturnTypesC');

self::assertEquals('string|false', $returnTypeA);
self::assertEquals('\Neos\Flow\Tests\Functional\Reflection\Fixtures\PHP8\DummyClassWithUnionTypeHints|false', $returnTypeB);
Expand Down

0 comments on commit d4bab72

Please sign in to comment.