Fix types on mock tests (#10230)
* Fix types on mock tests * Added $tty again Co-authored-by: Jakob Vibe <jv@ipw.dk>pull/10227/head
parent
e89459d964
commit
d06eb1ec3a
|
@ -122,21 +122,25 @@ class InstallationManagerMock extends InstallationManager
|
|||
parent::markAliasUninstalled($repo, $operation);
|
||||
}
|
||||
|
||||
/** @return string[] */
|
||||
public function getTrace()
|
||||
{
|
||||
return $this->trace;
|
||||
}
|
||||
|
||||
/** @return PackageInterface[] */
|
||||
public function getInstalledPackages()
|
||||
{
|
||||
return $this->installed;
|
||||
}
|
||||
|
||||
/** @return PackageInterface[][] */
|
||||
public function getUpdatedPackages()
|
||||
{
|
||||
return $this->updated;
|
||||
}
|
||||
|
||||
/** @return PackageInterface[] */
|
||||
public function getUninstalledPackages()
|
||||
{
|
||||
return $this->uninstalled;
|
||||
|
@ -147,6 +151,7 @@ class InstallationManagerMock extends InstallationManager
|
|||
// noop
|
||||
}
|
||||
|
||||
/** @return PackageInterface[] */
|
||||
public function getInstalledPackagesByType()
|
||||
{
|
||||
return $this->installed;
|
||||
|
|
|
@ -45,6 +45,8 @@ class ProcessExecutorMock extends ProcessExecutor
|
|||
* @param array<string|array{cmd: string, return?: int, stdout?: string, stderr?: string, callback?: callable}> $expectations
|
||||
* @param bool $strict set to true if you want to provide *all* expected commands, and not just a subset you are interested in testing
|
||||
* @param array{return: int, stdout?: string, stderr?: string} $defaultHandler default command handler for undefined commands if not in strict mode
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function expects(array $expectations, $strict = false, array $defaultHandler = array('return' => 0, 'stdout' => '', 'stderr' => ''))
|
||||
{
|
||||
|
@ -62,6 +64,7 @@ class ProcessExecutorMock extends ProcessExecutor
|
|||
$this->defaultHandler = array_merge($this->defaultHandler, $defaultHandler);
|
||||
}
|
||||
|
||||
/** @return void */
|
||||
public function assertComplete(TestCase $testCase)
|
||||
{
|
||||
if ($this->expectations) {
|
||||
|
@ -96,6 +99,14 @@ class ProcessExecutorMock extends ProcessExecutor
|
|||
return $this->doExecute($command, $cwd, false);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $command
|
||||
* @param string $cwd
|
||||
* @param bool $tty
|
||||
* @param callable $output
|
||||
* @return mixed
|
||||
*/
|
||||
private function doExecute($command, $cwd, $tty, &$output = null)
|
||||
{
|
||||
$this->captureOutput = func_num_args() > 3;
|
||||
|
|
Loading…
Reference in New Issue