public function CoreCspSubscriberTest::setUp in Content-Security-Policy 8
Overrides UnitTestCase::setUp
File
- tests/
src/ Unit/ EventSubscriber/ CoreCspSubscriberTest.php, line 51
Class
- CoreCspSubscriberTest
- @coversDefaultClass \Drupal\csp\EventSubscriber\CoreCspSubscriber @group csp
Namespace
Drupal\Tests\csp\Unit\EventSubscriberCode
public function setUp() : void {
parent::setUp();
$this->libraryDependencyResolver = $this
->getMockBuilder(LibraryDependencyResolverInterface::class)
->disableOriginalConstructor()
->getMock();
$this->libraryDependencyResolver
->method('getLibrariesWithDependencies')
->willReturnArgument(0);
$this->moduleHandler = $this
->getMockBuilder(ModuleHandlerInterface::class)
->disableOriginalConstructor()
->getMock();
$this->response = $this
->getMockBuilder(HtmlResponse::class)
->disableOriginalConstructor()
->getMock();
$this->coreCspSubscriber = new CoreCspSubscriber($this->libraryDependencyResolver, $this->moduleHandler);
}