@@ -59,7 +59,7 @@ protected function setUp(): void
59
59
}
60
60
61
61
/**
62
- * Data Provider for beforeSendResponse ()
62
+ * Data Provider for testBeforeSendResponse ()
63
63
*
64
64
* @return array
65
65
*/
@@ -68,14 +68,14 @@ public function sendResponseDataProvider(): array
68
68
return [
69
69
[
70
70
"content " => "<body><h1>Test Title</h1> " .
71
- "<script text = \"text/javascript \">test</script> " .
72
- "<script text = \"text/x-magento-template \">test</script> " .
71
+ "<script type = \"text/x-magento-init \">test</script> " .
72
+ "<script type = \"text/x-magento-template \">test</script> " .
73
73
"<p>Test Content</p></body> " ,
74
74
"flag " => true ,
75
75
"result " => "<body><h1>Test Title</h1> " .
76
- "<script text = \"text/x-magento-template \">test</script> " .
76
+ "<script type = \"text/x-magento-template \">test</script> " .
77
77
"<p>Test Content</p> " .
78
- "<script text = \"text/javascript \">test</script> " .
78
+ "<script type = \"text/x-magento-init \">test</script> " .
79
79
"\n</body> "
80
80
],
81
81
[
@@ -121,16 +121,35 @@ public function testBeforeSendResponse($content, $isSetFlag, $result): void
121
121
$ this ->plugin ->beforeSendResponse ($ this ->httpMock );
122
122
}
123
123
124
+ /**
125
+ * Data Provider for testBeforeSendResponseIfGetContentIsNotAString()
126
+ *
127
+ * @return array
128
+ */
129
+ public function ifGetContentIsNotAStringDataProvider (): array
130
+ {
131
+ return [
132
+ [
133
+ 'content ' => []
134
+ ],
135
+ [
136
+ 'content ' => NULL
137
+ ]
138
+ ];
139
+ }
140
+
124
141
/**
125
142
* Test BeforeSendResponse if content is not a string
126
143
*
144
+ * @param string $content
127
145
* @return void
146
+ * @dataProvider ifGetContentIsNotAStringDataProvider
128
147
*/
129
- public function testBeforeSendResponseIfGetContentIsNotAString (): void
148
+ public function testBeforeSendResponseIfGetContentIsNotAString ($ content ): void
130
149
{
131
150
$ this ->httpMock ->expects ($ this ->once ())
132
151
->method ('getContent ' )
133
- ->willReturn ([] );
152
+ ->willReturn ($ content );
134
153
135
154
$ this ->scopeConfigMock ->expects ($ this ->never ())
136
155
->method ('isSetFlag ' )
0 commit comments