createStub(LockFactory::class); $lock = $this->createStub(SharedLockInterface::class); $lock->method('acquire')->willReturn(true); $locker->method('createLock')->willReturn($lock); $this->processHelper = $this->createMock(ProcessRunnerInterface::class); $command = new MigrateDatabaseCommand($locker, $this->processHelper); $this->commandTester = CliTestUtils::testerForCommand($command); } #[Test] public function migrationsCommandIsRunWithProperVerbosity(): void { $this->processHelper->expects($this->once())->method('run')->with($this->isInstanceOf(OutputInterface::class), [ MigrateDatabaseCommand::SCRIPT, MigrateDatabaseCommand::COMMAND, '--no-interaction', ]); $this->commandTester->execute([]); $output = $this->commandTester->getDisplay(); self::assertStringContainsString('Migrating database...', $output); self::assertStringContainsString('Database properly migrated!', $output); } }