N98\Magento\Command\Admin\User\DeleteUserCommandTest::testCanDeleteByUserName PHP Method

testCanDeleteByUserName() public method

    public function testCanDeleteByUserName()
    {
        $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->at(2))->method('getId')->will($this->returnValue(2));
        $this->userModel->expects($this->never())->method('load');
        $this->userModel->expects($this->once())->method('delete');
        $application = $this->getApplication();
        $application->add($this->command);
        $command = $this->getApplication()->find('admin:user:delete');
        $commandTester = new CommandTester($command);
        $commandTester->execute(array('command' => $command->getName(), 'id' => 'aydin', '--force' => true));
        $this->assertContains('User was successfully deleted', $commandTester->getDisplay());
    }