@@ -45,20 +45,16 @@ function it_logs_request_and_response(
45
45
$ logger ->info (
46
46
"Sending request: \nGET / 1.1 " ,
47
47
Argument::that (
48
- function (array $ context ) use ($ request ) {
49
- return $ context ['request ' ] === $ request ->getWrappedObject ()
50
- && is_string ($ context ['uid ' ])
51
- ;
48
+ function (array $ context ) {
49
+ return is_string ($ context ['uid ' ]);
52
50
}
53
51
)
54
52
)->shouldBeCalled ();
55
53
$ logger ->info (
56
54
"Received response: \n200 OK 1.1 " ,
57
55
Argument::that (
58
- function (array $ context ) use ($ request , $ response ) {
59
- return $ context ['request ' ] === $ request ->getWrappedObject ()
60
- && $ context ['response ' ] === $ response ->getWrappedObject ()
61
- && is_int ($ context ['milliseconds ' ])
56
+ function (array $ context ) {
57
+ return is_int ($ context ['milliseconds ' ])
62
58
&& is_string ($ context ['uid ' ])
63
59
;
64
60
}
@@ -81,19 +77,16 @@ function it_logs_exception(LoggerInterface $logger, Formatter $formatter, Reques
81
77
$ logger ->info (
82
78
"Sending request: \nGET / 1.1 " ,
83
79
Argument::that (
84
- function (array $ context ) use ($ request ) {
85
- return $ context ['request ' ] === $ request ->getWrappedObject ()
86
- && is_string ($ context ['uid ' ])
87
- ;
80
+ function (array $ context ) {
81
+ return is_string ($ context ['uid ' ]);
88
82
}
89
83
)
90
84
)->shouldBeCalled ();
91
85
$ logger ->error (
92
86
"Error: \nCannot connect \nwhen sending request: \nGET / 1.1 " ,
93
87
Argument::that (
94
- function (array $ context ) use ($ request , $ exception ) {
95
- return $ context ['request ' ] === $ request ->getWrappedObject ()
96
- && $ context ['exception ' ] === $ exception
88
+ function (array $ context ) use ($ exception ) {
89
+ return $ context ['exception ' ] === $ exception
97
90
&& is_int ($ context ['milliseconds ' ])
98
91
&& is_string ($ context ['uid ' ])
99
92
;
@@ -122,20 +115,16 @@ function it_logs_response_within_exception(
122
115
$ logger ->info (
123
116
"Sending request: \nGET / 1.1 " ,
124
117
Argument::that (
125
- function (array $ context ) use ($ request ) {
126
- return $ context ['request ' ] === $ request ->getWrappedObject ()
127
- && is_string ($ context ['uid ' ])
128
- ;
118
+ function (array $ context ) {
119
+ return is_string ($ context ['uid ' ]);
129
120
}
130
121
)
131
122
)->shouldBeCalled ();
132
123
$ logger ->error (
133
124
"Error: \nForbidden \nwith response: \n403 Forbidden 1.1 " ,
134
125
Argument::that (
135
- function (array $ context ) use ($ request , $ response , $ exception ) {
136
- return $ context ['request ' ] === $ request ->getWrappedObject ()
137
- && $ context ['response ' ] === $ response ->getWrappedObject ()
138
- && $ context ['exception ' ] === $ exception
126
+ function (array $ context ) use ($ exception ) {
127
+ return $ context ['exception ' ] === $ exception
139
128
&& is_int ($ context ['milliseconds ' ])
140
129
&& is_string ($ context ['uid ' ])
141
130
;
0 commit comments