Skip to content

Commit f0758f3

Browse files
author
al.kravchuk
committed
magento/magento2##15505: Interceptor class methods do not support nullable return types.
- removed junk; - use 'required' PHP_Unit directive to skip tests, which require PHP 7.1.
1 parent 87ab26f commit f0758f3

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

dev/tests/integration/testsuite/Magento/Framework/Code/GeneratorTest.php

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,11 @@ public function testGenerateClassExtensionAttributesInterfaceFactoryWithNamespac
187187
$this->assertEquals($expectedContent, $content);
188188
}
189189

190+
/**
191+
* @requires PHP 7.1
192+
*/
190193
public function testGenerateClassProxyWithNamespace71()
191194
{
192-
if (!$this->shouldRun71()) {
193-
$this->assertTrue(true);
194-
return;
195-
}
196-
197195
$proxyClassName = self::CLASS_NAME_WITH_NAMESPACE_71 . '\Proxy';
198196
$result = false;
199197
$generatorResult = $this->_generator->generateClass($proxyClassName);
@@ -219,13 +217,11 @@ public function testGenerateClassProxyWithNamespace71()
219217
}
220218
}
221219

220+
/**
221+
* @requires PHP 7.1
222+
*/
222223
public function testGenerateClassInterceptorWithNamespace71()
223224
{
224-
if (!$this->shouldRun71()) {
225-
$this->assertTrue(true);
226-
return;
227-
}
228-
229225
$interceptorClassName = self::CLASS_NAME_WITH_NAMESPACE_71 . '\Interceptor';
230226
$result = false;
231227
$generatorResult = $this->_generator->generateClass($interceptorClassName);
@@ -246,12 +242,4 @@ public function testGenerateClassInterceptorWithNamespace71()
246242
$this->assertEquals($expectedContent, $content);
247243
}
248244
}
249-
250-
/**
251-
* @return bool
252-
*/
253-
private function shouldRun71():bool
254-
{
255-
return version_compare(phpversion(), '7.1.0', '>=');
256-
}
257245
}

lib/internal/Magento/Framework/Interception/Code/Generator/Interceptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
/**
1010
* Class Interceptor
11-
˚*
11+
*
1212
* @package Magento\Framework\Interception\Code\Generator
1313
*/
1414
class Interceptor extends \Magento\Framework\Code\Generator\EntityAbstract

0 commit comments

Comments
 (0)