N98\Magento\Command\Admin\User\ChangePasswordCommandTest::testReturnEarlyIfUserNotFound PHP Method

testReturnEarlyIfUserNotFound() public method

    public function testReturnEarlyIfUserNotFound()
    {
        $this->userModel->expects($this->once())->method('loadByUsername')->with('notauser')->will($this->returnValue($this->userModel));
        $this->userModel->expects($this->at(1))->method('getId')->will($this->returnValue(null));
        $application = $this->getApplication();
        $application->add($this->command);
        $command = $this->getApplication()->find($this->commandName);
        $commandTester = new CommandTester($command);
        $commandTester->execute(array('command' => $command->getName(), 'username' => 'notauser'));
        $this->assertContains('User was not found', $commandTester->getDisplay());
    }