File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
tests/Doctrine/Tests/Common/Proxy Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Doctrine \Tests \Common \Proxy ;
4
+
5
+ class Php8MagicCloneClass
6
+ {
7
+ public function __clone (): void
8
+ {
9
+ }
10
+ }
Original file line number Diff line number Diff line change @@ -405,6 +405,26 @@ public function testFinalClassThrowsException()
405
405
$ proxyGenerator ->generateProxyClass ($ this ->createClassMetadata (FinalClass::class, []));
406
406
}
407
407
408
+ /**
409
+ * @requires PHP >= 8.0.0
410
+ */
411
+ public function testPhp8CloneWithVoidReturnType ()
412
+ {
413
+ $ className = Php8MagicCloneClass::class;
414
+
415
+ if ( ! class_exists ('Doctrine\Tests\Common\ProxyProxy\__CG__\Php8MagicCloneClass ' , false )) {
416
+ $ metadata = $ this ->createClassMetadata ($ className , ['id ' ]);
417
+
418
+ $ proxyGenerator = new ProxyGenerator (__DIR__ . '/generated ' , __NAMESPACE__ . 'Proxy ' );
419
+ $ this ->generateAndRequire ($ proxyGenerator , $ metadata );
420
+ }
421
+
422
+ self ::assertStringContainsString (
423
+ 'public function __clone(): void ' ,
424
+ file_get_contents (__DIR__ . '/generated/__CG__DoctrineTestsCommonProxyPhp8MagicCloneClass.php ' )
425
+ );
426
+ }
427
+
408
428
/**
409
429
* @requires PHP >= 8.0.0
410
430
*/
You can’t perform that action at this time.
0 commit comments