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

testCanChangePassword() public method

    public function testCanChangePassword()
    {
        $this->userModel->expects($this->once())->method('loadByUsername')->with('aydin')->will($this->returnValue($this->userModel));
        $this->userModel->expects($this->at(1))->method('getId')->will($this->returnValue(2));
        $this->userModel->expects($this->once())->method('validate');
        $this->userModel->expects($this->once())->method('save');
        $application = $this->getApplication();
        $application->add($this->command);
        $command = $this->getApplication()->find($this->commandName);
        $commandTester = new CommandTester($command);
        $commandTester->execute(array('command' => $command->getName(), 'username' => 'aydin', 'password' => 'password'));
        $this->assertContains('Password successfully changed', $commandTester->getDisplay());
    }