diff options
Diffstat (limited to 'tests/lib/Command')
-rw-r--r-- | tests/lib/Command/AsyncBusTestCase.php | 15 | ||||
-rw-r--r-- | tests/lib/Command/Integrity/SignAppTest.php | 14 | ||||
-rw-r--r-- | tests/lib/Command/Integrity/SignCoreTest.php | 12 |
3 files changed, 20 insertions, 21 deletions
diff --git a/tests/lib/Command/AsyncBusTestCase.php b/tests/lib/Command/AsyncBusTestCase.php index c4f173f8b32..6aca4d8d6e6 100644 --- a/tests/lib/Command/AsyncBusTestCase.php +++ b/tests/lib/Command/AsyncBusTestCase.php @@ -20,10 +20,9 @@ class SimpleCommand implements ICommand { } class StateFullCommand implements ICommand { - private $state; - - public function __construct($state) { - $this->state = $state; + public function __construct( + private $state, + ) { } public function handle() { @@ -50,7 +49,7 @@ class ThisClosureTest { } public function test(IBus $bus) { - $bus->push(function () { + $bus->push(function (): void { $this->privateMethod(); }); } @@ -126,7 +125,7 @@ abstract class AsyncBusTestCase extends TestCase { } public function testClosure(): void { - $this->getBus()->push(function () { + $this->getBus()->push(function (): void { AsyncBusTestCase::$lastCommand = 'closure'; }); $this->runJobs(); @@ -134,7 +133,7 @@ abstract class AsyncBusTestCase extends TestCase { } public function testClosureSelf(): void { - $this->getBus()->push(function () { + $this->getBus()->push(function (): void { AsyncBusTestCase::$lastCommand = 'closure-self'; }); $this->runJobs(); @@ -152,7 +151,7 @@ abstract class AsyncBusTestCase extends TestCase { public function testClosureBind(): void { $state = 'bar'; - $this->getBus()->push(function () use ($state) { + $this->getBus()->push(function () use ($state): void { AsyncBusTestCase::$lastCommand = 'closure-' . $state; }); $this->runJobs(); diff --git a/tests/lib/Command/Integrity/SignAppTest.php b/tests/lib/Command/Integrity/SignAppTest.php index 38b5c68e026..15f98dba0c0 100644 --- a/tests/lib/Command/Integrity/SignAppTest.php +++ b/tests/lib/Command/Integrity/SignAppTest.php @@ -58,7 +58,7 @@ class SignAppTest extends TestCase { $outputInterface ->expects($this->any()) ->method('writeln') - ->willReturnCallback(function (string $message) use (&$calls) { + ->willReturnCallback(function (string $message) use (&$calls): void { $expected = array_shift($calls); if ($expected === '*') { $this->assertNotEmpty($message); @@ -91,7 +91,7 @@ class SignAppTest extends TestCase { $outputInterface ->expects($this->any()) ->method('writeln') - ->willReturnCallback(function (string $message) use (&$calls) { + ->willReturnCallback(function (string $message) use (&$calls): void { $expected = array_shift($calls); if ($expected === '*') { $this->assertNotEmpty($message); @@ -124,7 +124,7 @@ class SignAppTest extends TestCase { $outputInterface ->expects($this->any()) ->method('writeln') - ->willReturnCallback(function (string $message) use (&$calls) { + ->willReturnCallback(function (string $message) use (&$calls): void { $expected = array_shift($calls); if ($expected === '*') { $this->assertNotEmpty($message); @@ -160,7 +160,7 @@ class SignAppTest extends TestCase { $outputInterface ->expects($this->any()) ->method('writeln') - ->willReturnCallback(function (string $message) { + ->willReturnCallback(function (string $message): void { $this->assertEquals('Private key "privateKey" does not exists.', $message); }); @@ -191,7 +191,7 @@ class SignAppTest extends TestCase { $outputInterface ->expects($this->any()) ->method('writeln') - ->willReturnCallback(function (string $message) { + ->willReturnCallback(function (string $message): void { $this->assertEquals('Certificate "certificate" does not exists.', $message); }); @@ -227,7 +227,7 @@ class SignAppTest extends TestCase { $outputInterface ->expects($this->any()) ->method('writeln') - ->willReturnCallback(function (string $message) { + ->willReturnCallback(function (string $message): void { $this->assertEquals('Error: My error message', $message); }); @@ -262,7 +262,7 @@ class SignAppTest extends TestCase { $outputInterface ->expects($this->any()) ->method('writeln') - ->willReturnCallback(function (string $message) { + ->willReturnCallback(function (string $message): void { $this->assertEquals('Successfully signed "AppId"', $message); }); diff --git a/tests/lib/Command/Integrity/SignCoreTest.php b/tests/lib/Command/Integrity/SignCoreTest.php index 66227322dda..efff6da2f95 100644 --- a/tests/lib/Command/Integrity/SignCoreTest.php +++ b/tests/lib/Command/Integrity/SignCoreTest.php @@ -48,7 +48,7 @@ class SignCoreTest extends TestCase { $outputInterface ->expects($this->any()) ->method('writeln') - ->willReturnCallback(function (string $message) { + ->willReturnCallback(function (string $message): void { $this->assertEquals('--privateKey, --certificate and --path are required.', $message); }); @@ -71,7 +71,7 @@ class SignCoreTest extends TestCase { $outputInterface ->expects($this->any()) ->method('writeln') - ->willReturnCallback(function (string $message) { + ->willReturnCallback(function (string $message): void { $this->assertEquals('--privateKey, --certificate and --path are required.', $message); }); @@ -100,7 +100,7 @@ class SignCoreTest extends TestCase { $outputInterface ->expects($this->any()) ->method('writeln') - ->willReturnCallback(function (string $message) { + ->willReturnCallback(function (string $message): void { $this->assertEquals('Private key "privateKey" does not exists.', $message); }); @@ -131,7 +131,7 @@ class SignCoreTest extends TestCase { $outputInterface ->expects($this->any()) ->method('writeln') - ->willReturnCallback(function (string $message) { + ->willReturnCallback(function (string $message): void { $this->assertEquals('Certificate "certificate" does not exists.', $message); }); @@ -167,7 +167,7 @@ class SignCoreTest extends TestCase { $outputInterface ->expects($this->any()) ->method('writeln') - ->willReturnCallback(function (string $message) { + ->willReturnCallback(function (string $message): void { $this->assertEquals('Error: My exception message', $message); }); @@ -202,7 +202,7 @@ class SignCoreTest extends TestCase { $outputInterface ->expects($this->any()) ->method('writeln') - ->willReturnCallback(function (string $message) { + ->willReturnCallback(function (string $message): void { $this->assertEquals('Successfully signed "core"', $message); }); |