Browse Source

Class "ProgressBar" is declared "final" and cannot be mocked.

Signed-off-by: Joas Schilling <coding@schilljs.com>
tags/v14.0.0beta1
Joas Schilling 6 years ago
parent
commit
3917a54113
No account linked to committer's email address

+ 4
- 2
apps/encryption/tests/Crypto/EncryptAllTest.php View File

@@ -335,8 +335,10 @@ class EncryptAllTest extends TestCase {
$encryptAll->expects($this->at(1))->method('encryptFile')->with('/user1/files/bar');
$encryptAll->expects($this->at(2))->method('encryptFile')->with('/user1/files/foo/subfile');

$progressBar = $this->getMockBuilder(ProgressBar::class)
->disableOriginalConstructor()->getMock();
$this->outputInterface->expects($this->any())
->method('getFormatter')
->willReturn($this->createMock(OutputFormatterInterface::class));
$progressBar = new ProgressBar($this->outputInterface);

$this->invokePrivate($encryptAll, 'encryptUsersFiles', ['user1', $progressBar, '']);


+ 5
- 2
tests/lib/Encryption/DecryptAllTest.php View File

@@ -301,8 +301,11 @@ class DecryptAllTest extends TestCase {
->method('decryptFile')
->with('/user1/files/foo/subfile');

$progressBar = $this->getMockBuilder(ProgressBar::class)
->disableOriginalConstructor()->getMock();
$output = $this->createMock(OutputInterface::class);
$output->expects($this->any())
->method('getFormatter')
->willReturn($this->createMock(OutputFormatterInterface::class));
$progressBar = new ProgressBar($output);

$this->invokePrivate($instance, 'decryptUsersFiles', ['user1', $progressBar, '']);


Loading…
Cancel
Save