22
22
* payment-gateway-logger
23
23
*
24
24
* @package payment-gateway-logger
25
- * @author manzoj
26
25
* @version 1
27
26
*/
28
27
@@ -42,11 +41,6 @@ class OmnipayGatewayRequestSubscriberTest extends TestCase
42
41
*/
43
42
private $ logger ;
44
43
45
- /**
46
- * @var string
47
- */
48
- private $ requestName = 'test_request_name ' ;
49
-
50
44
/**
51
45
* @return void
52
46
*/
@@ -73,9 +67,9 @@ public function providerLoggingEvents()
73
67
/** @var Exception $exception */
74
68
$ exception = Mockery::mock ('Exception ' );
75
69
76
- $ requestEvent = new RequestEvent ($ request, $ this -> requestName );
77
- $ responseEvent = new ResponseEvent ($ response, $ this -> requestName );
78
- $ errorEvent = new ErrorEvent ($ exception , $ this -> requestName );
70
+ $ requestEvent = new RequestEvent ($ request );
71
+ $ responseEvent = new ResponseEvent ($ response );
72
+ $ errorEvent = new ErrorEvent ($ exception , $ request );
79
73
80
74
$ requestRecord = array (
81
75
'level ' => LogLevel::INFO ,
@@ -116,7 +110,6 @@ public function testLogging($event_type, $event, array $record)
116
110
$ this ->eventDispatcher ->dispatch ($ event_type , $ event );
117
111
118
112
$ context = $ event ->toArray ();
119
- $ this ->assertEquals ($ this ->requestName , $ context ['request_name ' ]);
120
113
121
114
if ($ record ['level ' ] === LogLevel::INFO ) {
122
115
$ this ->assertInstanceOf ('Omnipay\Common\Message\RequestInterface ' , $ context ['request ' ]);
@@ -128,6 +121,7 @@ public function testLogging($event_type, $event, array $record)
128
121
$ this ->assertTrue ($ this ->logger ->hasNotice ($ record ));
129
122
} else if ($ record ['level ' ] === LogLevel::ERROR ) {
130
123
$ this ->assertInstanceOf ('\Exception ' , $ context ['error ' ]);
124
+ $ this ->assertInstanceOf ('Omnipay\Common\Message\RequestInterface ' , $ context ['request ' ]);
131
125
$ this ->assertTrue ($ this ->logger ->hasErrorRecords ());
132
126
$ this ->assertTrue ($ this ->logger ->hasError ($ record ));
133
127
} else {
0 commit comments