17 private $objectManagerMock;
27 private $signUpCommandMock;
36 $this->objectManagerMock = $this->getMockBuilder(ObjectManagerInterface::class)
37 ->disableOriginalConstructor()
39 $this->signUpCommandMock = $this->getMockBuilder(SignUpCommand::class)
40 ->disableOriginalConstructor()
42 $this->commands = [
'signUp' => SignUpCommand::class];
43 $this->connector =
new Connector($this->commands, $this->objectManagerMock);
48 $commandName =
'signUp';
49 $this->objectManagerMock->expects($this->once())
51 ->with($this->commands[$commandName])
52 ->willReturn($this->signUpCommandMock);
53 $this->signUpCommandMock->expects($this->once())
56 $this->assertTrue($this->connector->execute($commandName));
64 $commandName =
'register';
65 $this->connector->execute($commandName);
testExecuteCommandNotFound()