/* We need format method to return a string */
$outputFormatter = $this->createMock(OutputFormatterInterface::class);
+ $outputFormatter->method('isDecorated')->willReturn(false);
$outputFormatter->method('format')->willReturnArgument(0);
$this->outputInterface->expects($this->any())->method('getFormatter')
['/user1/files/foo/subfile'],
);
+ $outputFormatter = $this->createMock(OutputFormatterInterface::class);
+ $outputFormatter->method('isDecorated')->willReturn(false);
$this->outputInterface->expects($this->any())
->method('getFormatter')
- ->willReturn($this->createMock(OutputFormatterInterface::class));
+ ->willReturn($outputFormatter);
$progressBar = new ProgressBar($this->outputInterface);
$this->invokePrivate($encryptAll, 'encryptUsersFiles', ['user1', $progressBar, '']);
/**
* Formats a message according to the given styles.
*
- * @param string $message The message to style
- * @return string The styled message, prepended with a timestamp using the
+ * @param string|null $message The message to style
+ * @return string|null The styled message, prepended with a timestamp using the
* log timezone and dateformat, e.g. "2015-06-23T17:24:37+02:00"
*/
- public function format($message) {
+ public function format(?string $message): ?string {
if (!$this->formatter->isDecorated()) {
// Don't add anything to the output when we shouldn't
return $this->formatter->format($message);
/* We need format method to return a string */
$outputFormatter = $this->createMock(OutputFormatterInterface::class);
+ $outputFormatter->method('isDecorated')->willReturn(false);
$outputFormatter->method('format')->willReturnArgument(0);
$this->outputInterface->expects($this->any())->method('getFormatter')
/* We need format method to return a string */
$outputFormatter = $this->createMock(OutputFormatterInterface::class);
+ $outputFormatter->method('isDecorated')->willReturn(false);
$outputFormatter->method('format')->willReturnArgument(0);
$this->output->expects($this->any())
->disableOriginalConstructor()->getMock();
$this->outputInterface = $this->getMockBuilder(OutputInterface::class)
->disableOriginalConstructor()->getMock();
+ $this->outputInterface->expects($this->any())->method('isDecorated')
+ ->willReturn(false);
$this->userInterface = $this->getMockBuilder(UserInterface::class)
->disableOriginalConstructor()->getMock();
/* We need format method to return a string */
$outputFormatter = $this->createMock(OutputFormatterInterface::class);
$outputFormatter->method('format')->willReturn('foo');
+ $outputFormatter->method('isDecorated')->willReturn(false);
$this->outputInterface->expects($this->any())->method('getFormatter')
->willReturn($outputFormatter);
/* We need format method to return a string */
$outputFormatter = $this->createMock(OutputFormatterInterface::class);
+ $outputFormatter->method('isDecorated')->willReturn(false);
$outputFormatter->method('format')->willReturn('foo');
$output = $this->createMock(OutputInterface::class);