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 1818 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
1919 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2020 * @magentoAppArea frontend
21+ * @magentoAppIsolation enabled
2122 */
2223class FrontControllerTest extends TestCase
2324{
@@ -118,4 +119,24 @@ public function testInvalidRequest()
118119 $ this ->_model ->dispatch ($ request )
119120 );
120121 }
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+ }
121142}
You can’t perform that action at this time.
0 commit comments