/** * @return void */ public function testCreateArbitrary() { $contextMock = $this->getMockBuilder('Magento\\Framework\\View\\Asset\\ContextInterface')->disableOriginalConstructor()->getMock(); $this->contextFactoryMock->expects($this->once())->method('create')->with(['baseUrl' => '', 'baseDirType' => 'dirType', 'contextPath' => 'dir/path'])->willReturn($contextMock); $assetMock = $this->getMockBuilder('Magento\\Framework\\View\\Asset\\File')->disableOriginalConstructor()->getMock(); $this->fileFactoryMock->expects($this->once())->method('create')->with(['source' => $this->sourceMock, 'context' => $contextMock, 'filePath' => 'test/file.js', 'module' => '', 'contentType' => ''])->willReturn($assetMock); $this->assertEquals($assetMock, $this->repository->createArbitrary('test/file.js', 'dir/path', 'dirType', 'static')); }