File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
dev/tests/integration/testsuite/Magento/Framework/App Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 18
18
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
19
19
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
20
20
* @magentoAppArea frontend
21
+ * @magentoAppIsolation enabled
21
22
*/
22
23
class FrontControllerTest extends TestCase
23
24
{
@@ -118,4 +119,24 @@ public function testInvalidRequest()
118
119
$ this ->_model ->dispatch ($ request )
119
120
);
120
121
}
122
+
123
+ public function testDispatchWithAcceptHeader (): void
124
+ {
125
+ if (!Bootstrap::canTestHeaders ()) {
126
+ $ this ->markTestSkipped ('Can \'t test dispatch process without sending headers ' );
127
+ }
128
+
129
+ $ this ->fakeRequestValidator ->valid = true ;
130
+ $ _SERVER ['HTTP_HOST ' ] = 'localhost ' ;
131
+ $ this ->_objectManager ->get (State::class)->setAreaCode ('frontend ' );
132
+ $ request = $ this ->_objectManager ->get (HttpRequest::class);
133
+ $ request ->setRequestUri ('/checkout ' );
134
+ $ headers = $ request ->getHeaders ();
135
+ $ headers ->addHeaderLine ('Accept ' , 'text/html ' );
136
+ $ request ->setHeaders ($ headers );
137
+ $ this ->assertInstanceOf (
138
+ ResultInterface::class,
139
+ $ this ->_model ->dispatch ($ request )
140
+ );
141
+ }
121
142
}
You can’t perform that action at this time.
0 commit comments