summaryrefslogtreecommitdiffstats
path: root/33.patch
blob: a24d9ab870ed3dea771c3c86dd10e52437bc5cfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From a17d2a6e464247f5df5ff515d1f017404da78e8b Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 23 Oct 2017 16:42:09 +0200
Subject: [PATCH] fix for PHP 7.2, 'Object' is a reserved keyword

---
 test/JsonTest.php                             | 12 ++++++------
 test/TestAsset/{Object.php => TestObject.php} |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
 rename test/TestAsset/{Object.php => TestObject.php} (97%)

diff --git a/test/JsonTest.php b/test/JsonTest.php
index e0c7d45d9..700271ea9 100644
--- a/test/JsonTest.php
+++ b/test/JsonTest.php
@@ -483,11 +483,11 @@ public function testZf4053()
 
     public function testEncodeObject()
     {
-        $actual  = new TestAsset\Object();
+        $actual  = new TestAsset\TestObject();
         $encoded = Json\Encoder::encode($actual);
         $decoded = Json\Decoder::decode($encoded, Json\Json::TYPE_OBJECT);
 
-        $this->assertAttributeEquals(TestAsset\Object::class, '__className', $decoded);
+        $this->assertAttributeEquals(TestAsset\TestObject::class, '__className', $decoded);
         $this->assertAttributeEquals('bar', 'foo', $decoded);
         $this->assertAttributeEquals('baz', 'bar', $decoded);
         $this->assertFalse(isset($decoded->_foo));
@@ -495,9 +495,9 @@ public function testEncodeObject()
 
     public function testEncodeClass()
     {
-        $encoded = Json\Encoder::encodeClass(TestAsset\Object::class);
+        $encoded = Json\Encoder::encodeClass(TestAsset\TestObject::class);
 
-        $this->assertContains("Class.create('ZendTest\\Json\\TestAsset\\Object'", $encoded);
+        $this->assertContains("Class.create('ZendTest\\Json\\TestAsset\\TestObject'", $encoded);
         $this->assertContains("ZAjaxEngine.invokeRemoteMethod(this, 'foo'", $encoded);
         $this->assertContains("ZAjaxEngine.invokeRemoteMethod(this, 'bar'", $encoded);
         $this->assertNotContains("ZAjaxEngine.invokeRemoteMethod(this, 'baz'", $encoded);
@@ -508,9 +508,9 @@ public function testEncodeClass()
 
     public function testEncodeClasses()
     {
-        $encoded = Json\Encoder::encodeClasses(['ZendTest\Json\TestAsset\Object', 'Zend\Json\Json']);
+        $encoded = Json\Encoder::encodeClasses(['ZendTest\Json\TestAsset\TestObject', 'Zend\Json\Json']);
 
-        $this->assertContains("Class.create('ZendTest\\Json\\TestAsset\\Object'", $encoded);
+        $this->assertContains("Class.create('ZendTest\\Json\\TestAsset\\TestObject'", $encoded);
         $this->assertContains("Class.create('Zend\\Json\\Json'", $encoded);
     }
 
diff --git a/test/TestAsset/Object.php b/test/TestAsset/TestObject.php
similarity index 97%
rename from test/TestAsset/Object.php
rename to test/TestAsset/TestObject.php
index 5ee251254..22cad55b9 100644
--- a/test/TestAsset/Object.php
+++ b/test/TestAsset/TestObject.php
@@ -10,7 +10,7 @@
 /**
  * Test class for encoding classes.
  */
-class Object
+class TestObject
 {
     const FOO = 'bar';