summaryrefslogtreecommitdiffstats
path: root/798.patch
blob: c394c248cc9dfc582782ebec3d37bdbf7559fcf8 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
From ebcef93d662613c48eb8f9b53470992a66aaca9c Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Fri, 6 Oct 2017 14:51:05 +0200
Subject: [PATCH 1/2] fix for 7.2

---
 tests/Mockery/DemeterChainTest.php | 2 +-
 tests/Mockery/ExpectationTest.php  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/Mockery/DemeterChainTest.php b/tests/Mockery/DemeterChainTest.php
index 9767f1ee..deed5eef 100644
--- a/tests/Mockery/DemeterChainTest.php
+++ b/tests/Mockery/DemeterChainTest.php
@@ -28,7 +28,7 @@ class DemeterChainTest extends MockeryTestCase
 
     public function setUp()
     {
-        $this->mock = $this->mock = Mockery::mock('object')->shouldIgnoreMissing();
+        $this->mock = $this->mock = Mockery::mock('stdClass')->shouldIgnoreMissing();
     }
 
     public function tearDown()
diff --git a/tests/Mockery/ExpectationTest.php b/tests/Mockery/ExpectationTest.php
index c3c31993..6d1ddf4d 100644
--- a/tests/Mockery/ExpectationTest.php
+++ b/tests/Mockery/ExpectationTest.php
@@ -1238,7 +1238,7 @@ public function testNumericConstraintThrowsExceptionWhenConstraintUnmatched()
 
     public function testObjectConstraintMatchesArgument()
     {
-        $this->mock->shouldReceive('foo')->with(Mockery::type('object'))->once();
+        $this->mock->shouldReceive('foo')->with(Mockery::type('stdClass'))->once();
         $this->mock->foo(new stdClass);
         $this->container->mockery_verify();
     }
@@ -1246,7 +1246,7 @@ public function testObjectConstraintMatchesArgument()
     public function testObjectConstraintNonMatchingCase()
     {
         $this->mock->shouldReceive('foo')->times(3);
-        $this->mock->shouldReceive('foo')->with(1, Mockery::type('object`'))->never();
+        $this->mock->shouldReceive('foo')->with(1, Mockery::type('stdClass`'))->never();
         $this->mock->foo();
         $this->mock->foo(1);
         $this->mock->foo(1, 2, 3);
@@ -1258,7 +1258,7 @@ public function testObjectConstraintNonMatchingCase()
      */
     public function testObjectConstraintThrowsExceptionWhenConstraintUnmatched()
     {
-        $this->mock->shouldReceive('foo')->with(Mockery::type('object'))->once();
+        $this->mock->shouldReceive('foo')->with(Mockery::type('stdClass'))->once();
         $this->mock->foo('f');
         $this->container->mockery_verify();
     }

From fe282c1ac52b127e4b8a66e9d46fb1edae1de8c7 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Fri, 6 Oct 2017 15:03:10 +0200
Subject: [PATCH 2/2] change mocked class to avoid Mockery/DateTimeZone.php not
 found

---
 library/Mockery/Loader/EvalLoader.php | 1 -
 tests/Mockery/NamedMockTest.php       | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/library/Mockery/Loader/EvalLoader.php b/library/Mockery/Loader/EvalLoader.php
index b9d172af..0fb62117 100644
--- a/library/Mockery/Loader/EvalLoader.php
+++ b/library/Mockery/Loader/EvalLoader.php
@@ -12,7 +12,6 @@ public function load(MockDefinition $definition)
         if (class_exists($definition->getClassName(), false)) {
             return;
         }
-
         eval("?>" . $definition->getCode());
     }
 }
diff --git a/tests/Mockery/NamedMockTest.php b/tests/Mockery/NamedMockTest.php
index 28920072..28dd2fdd 100644
--- a/tests/Mockery/NamedMockTest.php
+++ b/tests/Mockery/NamedMockTest.php
@@ -33,11 +33,11 @@ public function itCreatesANamedMock()
     /** @test */
     public function itCreatesPassesFurtherArgumentsJustLikeMock()
     {
-        $mock = Mockery::namedMock("Mockery\Dave456", "DateTime", array(
+        $mock = Mockery::namedMock("Mockery\Dave456", "DateTimeZone", array(
             "getDave" => "dave"
         ));
 
-        $this->assertInstanceOf("DateTime", $mock);
+        $this->assertInstanceOf("DateTimeZone", $mock);
         $this->assertEquals("dave", $mock->getDave());
     }