public function testGetRelativeUrl() { $filename = base64_encode('filename.ext'); $notRoot = base64_encode('not/a/root'); $this->request->expects($this->any())->method('getParam')->willReturnMap(['type' => [\Magento\Theme\Helper\Storage::PARAM_CONTENT_TYPE, null, \Magento\Theme\Model\Wysiwyg\Storage::TYPE_IMAGE], 'node' => [\Magento\Theme\Helper\Storage::PARAM_NODE, null, $notRoot], 'filenaem' => [\Magento\Theme\Helper\Storage::PARAM_FILENAME, null, $filename]]); $decode = function ($value) { return base64_decode($value); }; $this->urlDecoder->expects($this->at(0))->method('decode')->with($notRoot)->willReturnCallback($decode); $this->urlDecoder->expects($this->at(1))->method('decode')->with($filename)->willReturnCallback($decode); $this->assertEquals('../image/not/a/root/filename.ext', $this->helper->getRelativeUrl()); }