Since both services should use the same uri, we can use any of them to *GET* the URI.
public loadBinaryFileByUri ( $binaryFileUri ) |
public function testLoadBinaryFileByUriWithDraftFile() { $binaryFileUri = 'var/test/images-versioned/an/image.png'; $binaryFile = new BinaryFile(array('id' => 'an/image.png')); $this->publishedIoServiceMock->expects($this->once())->method('loadBinaryFileByUri')->with($binaryFileUri)->will($this->throwException(new InvalidArgumentException('$id', "Prefix not found in {$binaryFile->id}"))); $this->draftIoServiceMock->expects($this->once())->method('loadBinaryFileByUri')->with($binaryFileUri)->will($this->returnValue($binaryFile)); self::assertSame($binaryFile, $this->service->loadBinaryFileByUri($binaryFileUri)); }