It seems like $this->givenAFactoryWith...y('default', 'second')) targeting phpDocumentor\Console\Co...toryWithTemplateNames() can also be of type object<Mockery\MockInterface>; however, phpDocumentor\Console\Co...tCommand::__construct() does only seem to accept object<phpDocumentor\Tra...ormer\Template\Factory>, maybe add an additional type check?

This check looks at variables that are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...

33

34

$expectedOutput = <<<TXT

35

Available templates:

36

* default

37

* second

38

39

40

TXT;

41

$expectedOutput = str_replace("\n", PHP_EOL, $expectedOutput);

42

43

// Act

44

$commandTester = new CommandTester($command);

45

$commandTester->execute([], ['decorated' => false]);

46

47

// Assert

48

$this->assertSame($expectedOutput, $commandTester->getDisplay());

49

}

50

51

/**

52

* Returns a factory mock object with the provided template names returned using the `getAllNames()` method.