From 128273517a1b1229dd96bf45f4047028af2b24fa Mon Sep 17 00:00:00 2001 From: Andreas Fernandez <a.fernandez@scripting-base.de> Date: Tue, 19 Dec 2017 19:09:17 +0100 Subject: [PATCH] [BUGFIX] Use `new` in ReflectionServiceTest Resolves: #83390 Releases: master Change-Id: I1883a855ae818295eec9cd8b4ae2baeb93eff05c Reviewed-on: https://review.typo3.org/55164 Tested-by: TYPO3com <no-reply@typo3.com> Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de> Reviewed-by: Sebastian Fischer <typo3@evoweb.de> Reviewed-by: Joerg Boesche <typo3@joergboesche.de> Tested-by: Joerg Boesche <typo3@joergboesche.de> Reviewed-by: Andreas Fernandez <typo3@scripting-base.de> Tested-by: Andreas Fernandez <typo3@scripting-base.de> --- .../Unit/Reflection/ReflectionServiceTest.php | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php b/typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php index 3bbceaf7d86a..04838fba7e69 100644 --- a/typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php @@ -14,7 +14,6 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Reflection; * The TYPO3 project - inspiring people to share! */ -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Reflection\ReflectionService; /** @@ -46,7 +45,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa */ public function getClassTagsValues() { - $service = GeneralUtility::makeInstance(ReflectionService::class); + $service = new ReflectionService(); $classValues = $service->getClassTagsValues(static::class); $this->assertEquals([ 'see' => ['test for reflection'], @@ -64,7 +63,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa */ public function getClassTagValues() { - $service = GeneralUtility::makeInstance(ReflectionService::class); + $service = new ReflectionService(); $classValues = $service->getClassTagValues(static::class, 'see'); $this->assertEquals([ 'test for reflection', @@ -86,7 +85,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa */ public function hasMethod() { - $service = GeneralUtility::makeInstance(ReflectionService::class); + $service = new ReflectionService(); $this->assertTrue($service->hasMethod(static::class, 'fixtureMethodForMethodTagsValues')); $this->assertFalse($service->hasMethod(static::class, 'notExistentMethod')); $this->assertFalse($service->hasMethod('NonExistantNamespace\\NonExistantClass', 'notExistentMethod')); @@ -97,7 +96,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa */ public function getMethodTagsValues() { - $service = GeneralUtility::makeInstance(ReflectionService::class); + $service = new ReflectionService(); $tagsValues = $service->getMethodTagsValues(static::class, 'fixtureMethodForMethodTagsValues'); $this->assertEquals([ 'param' => ['array $foo The foo parameter'], @@ -120,7 +119,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa */ public function getMethodParameters() { - $service = GeneralUtility::makeInstance(ReflectionService::class); + $service = new ReflectionService(); $parameters = $service->getMethodParameters(static::class, 'fixtureMethodForMethodTagsValues'); $this->assertSame([ 'foo' => [ @@ -155,7 +154,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa */ public function getMethodParametersWithShortTypeNames() { - $service = GeneralUtility::makeInstance(ReflectionService::class); + $service = new ReflectionService(); $parameters = $service->getMethodParameters(static::class, 'fixtureMethodForMethodTagsValuesWithShortTypes'); $this->assertSame([ 'dummy' => [ @@ -191,7 +190,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa public function testIsClassTaggedWith() { - $service = GeneralUtility::makeInstance(ReflectionService::class); + $service = new ReflectionService(); $this->assertTrue($service->isClassTaggedWith( Fixture\DummyClassWithTags::class, 'see' @@ -210,7 +209,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa public function testIsPropertyTaggedWith() { - $service = GeneralUtility::makeInstance(ReflectionService::class); + $service = new ReflectionService(); $this->assertTrue($service->isPropertyTaggedWith( Fixture\DummyClassWithAllTypesOfProperties::class, 'propertyWithInjectAnnotation', @@ -238,8 +237,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa public function testgetPropertyTagValues() { - $service = GeneralUtility::makeInstance(ReflectionService::class); - + $service = new ReflectionService(); $this->assertSame( [], $service->getPropertyTagValues( @@ -261,8 +259,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa public function testGetPropertyTagsValues() { - $service = GeneralUtility::makeInstance(ReflectionService::class); - + $service = new ReflectionService(); $this->assertSame( [ 'inject' => [], @@ -295,8 +292,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa public function testGetClassPropertyNames() { - $service = GeneralUtility::makeInstance(ReflectionService::class); - + $service = new ReflectionService(); $this->assertSame( [ 'publicProperty', -- GitLab