@@ 64-80 (lines=17) @@ | ||
61 | )->willReturn([]); |
|
62 | } |
|
63 | ||
64 | public function testExecAbstractMethod() |
|
65 | { |
|
66 | $this->validSessionStorage(); |
|
67 | $amoCRMClient = new \mb24dev\AmoCRM\AmoCRMClient( |
|
68 | $this->client, $this->sessionStorage, $this->responseTransformer |
|
69 | ); |
|
70 | ||
71 | $method = $this->getMockForAbstractClass(MethodInterface::class); |
|
72 | $method->method('getUser')->willReturn( |
|
73 | new User('domain', 'login', 'hash') |
|
74 | ); |
|
75 | ||
76 | $method->method('buildRequest')->willReturn(new Request('post', 'url')); |
|
77 | $method->method('getResponseTransformer')->willReturn(null); |
|
78 | ||
79 | $this->assertEquals([], $amoCRMClient->exec($method)); |
|
80 | } |
|
81 | ||
82 | public function testSessionException() |
|
83 | { |
|
@@ 82-98 (lines=17) @@ | ||
79 | $this->assertEquals([], $amoCRMClient->exec($method)); |
|
80 | } |
|
81 | ||
82 | public function testSessionException() |
|
83 | { |
|
84 | $this->invalidSessionStorage(); |
|
85 | $amoCRMClient = new \mb24dev\AmoCRM\AmoCRMClient( |
|
86 | $this->client, $this->sessionStorage, $this->responseTransformer |
|
87 | ); |
|
88 | ||
89 | $method = $this->getMockForAbstractClass(MethodInterface::class); |
|
90 | $method->method('getUser')->willReturn( |
|
91 | new User('domain', 'login', 'hash') |
|
92 | ); |
|
93 | ||
94 | $method->method('buildRequest')->willReturn(new Request('post', 'url')); |
|
95 | $method->method('getResponseTransformer')->willReturn(null); |
|
96 | $this->expectException(Exception::class); |
|
97 | $amoCRMClient->exec($method); |
|
98 | } |
|
99 | ||
100 | } |
|
101 |