1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of Guzzle HTTP JSON-RPC |
5
|
|
|
* |
6
|
|
|
* Copyright (c) 2014 Nature Delivered Ltd. <http://graze.com> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
* |
11
|
|
|
* @see http://github.com/graze/guzzle-jsonrpc/blob/master/LICENSE |
12
|
|
|
* @link http://github.com/graze/guzzle-jsonrpc |
13
|
|
|
*/ |
14
|
|
|
|
15
|
|
|
namespace Graze\GuzzleHttp\JsonRpc\Test; |
16
|
|
|
|
17
|
|
|
use Mockery; |
18
|
|
|
use PHPUnit_Framework_TestCase as TestCase; |
19
|
|
|
|
20
|
|
|
class UnitTestCase extends TestCase |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* @return Mockery\MockInterface |
24
|
|
|
*/ |
25
|
|
|
protected function mockBeforeEvent() |
26
|
|
|
{ |
27
|
|
|
return Mockery::mock('GuzzleHttp\Event\BeforeEvent'); |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @return Mockery\MockInterface |
32
|
|
|
*/ |
33
|
|
|
protected function mockCompleteEvent() |
34
|
|
|
{ |
35
|
|
|
return Mockery::mock('GuzzleHttp\Event\CompleteEvent'); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @return Mockery\MockInterface |
40
|
|
|
*/ |
41
|
|
|
protected function mockErrorEvent() |
42
|
|
|
{ |
43
|
|
|
return Mockery::mock('GuzzleHttp\Event\ErrorEvent'); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @return Mockery\MockInterface |
48
|
|
|
*/ |
49
|
|
|
protected function mockHttpClient() |
50
|
|
|
{ |
51
|
|
|
return Mockery::mock('GuzzleHttp\ClientInterface'); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @return Mockery\MockInterface |
56
|
|
|
*/ |
57
|
|
|
protected function mockHttpHandler() |
58
|
|
|
{ |
59
|
|
|
return Mockery::mock('GuzzleHttp\HandlerStack'); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @return Mockery\MockInterface |
64
|
|
|
*/ |
65
|
|
|
protected function mockMessageFactory() |
66
|
|
|
{ |
67
|
|
|
return Mockery::mock('Graze\GuzzleHttp\JsonRpc\Message\MessageFactoryInterface'); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return Mockery\MockInterface |
72
|
|
|
*/ |
73
|
|
|
protected function mockPromise() |
74
|
|
|
{ |
75
|
|
|
return Mockery::mock('GuzzleHttp\Promise\PromiseInterface'); |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @return Mockery\MockInterface |
80
|
|
|
*/ |
81
|
|
|
protected function mockRequest() |
82
|
|
|
{ |
83
|
|
|
return Mockery::mock('Graze\GuzzleHttp\JsonRpc\Message\RequestInterface'); |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return Mockery\MockInterface |
88
|
|
|
*/ |
89
|
|
|
protected function mockResponse() |
90
|
|
|
{ |
91
|
|
|
return Mockery::mock('Graze\GuzzleHttp\JsonRpc\Message\ResponseInterface'); |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @return Mockery\MockInterface |
96
|
|
|
*/ |
97
|
|
|
protected function mockStream() |
98
|
|
|
{ |
99
|
|
|
return Mockery::mock('GuzzleHttp\Stream\StreamInterface'); |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @return Mockery\MockInterface |
104
|
|
|
*/ |
105
|
|
|
protected function mockTransaction() |
106
|
|
|
{ |
107
|
|
|
return Mockery::mock('GuzzleHttp\Adapter\TransactionInterface'); |
108
|
|
|
} |
109
|
|
|
} |
110
|
|
|
|