Skip to content

Commit

Permalink
Fix tests on PHP 8.2 (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed May 29, 2022
1 parent 10dcfce commit 6e6ce1e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php
Expand Up @@ -95,14 +95,20 @@ public function testInstantiationFromNonExistingClass(string $invalidClassName):

public function testInstancesAreNotCloned(): void
{
$namespace = __NAMESPACE__;
$className = 'TemporaryClass' . str_replace('.', '', uniqid('', true));

eval('namespace ' . __NAMESPACE__ . '; class ' . $className . '{}');
eval(<<< PHP
namespace $namespace;
#[\AllowDynamicProperties]
class $className {}
PHP
);

/**
* @phpstan-var class-string
*/
$classNameWithNamespace = __NAMESPACE__ . '\\' . $className;
$classNameWithNamespace = $namespace . '\\' . $className;

$instance = $this->instantiator->instantiate($classNameWithNamespace);

Expand Down

0 comments on commit 6e6ce1e

Please sign in to comment.