getRequest()->setMethod('GET'); $this->dispatch('csputil/csp/helper'); $content = $this->getResponse()->getContent(); $this->assertStringContainsString( '', $content ); $this->assertStringContainsString("\n let myVar = 1;\n", $content); $header = $this->getResponse()->getHeader('Content-Security-Policy'); $this->assertNotEmpty($header); $this->assertStringContainsString('http://my.magento.com', $header->getFieldValue()); } }