We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5302ef1 commit 97e3450Copy full SHA for 97e3450
phpunit-tests/ClassInstantiationTest.php
@@ -0,0 +1,39 @@
1
+<?php
2
+
3
+declare(strict_types=1);
4
5
+namespace App\Tests;
6
7
+class ClassInstantiationTest extends RepresenterTestCase
8
+{
9
+ /**
10
+ * Ensures that we represent with parentheses to avoid having to re-run the representer.
11
+ */
12
+ public function testBackwardCompatibility(): void
13
+ {
14
+ $this->assertRepresentation(
15
+ <<<'CODE'
16
+ <?php
17
+ new MyClass()->method();
18
+ CODE,
19
20
+ (new C0())->m0();
21
22
+ '{"C0":"MyClass","m0":"method"}',
23
+ );
24
+ }
25
26
+ public function testClassInstantiation(): void
27
28
+ $this->assertSameRepresentation(
29
30
31
+ (new MyClass())->method();
32
33
34
35
36
37
38
39
+}
0 commit comments