N98\Magento\Command\Admin\User\CreateUserCommandTest::testInvalidRole PHP Метод

testInvalidRole() публичный Метод

public testInvalidRole ( )
    public function testInvalidRole()
    {
        $application = $this->getApplication();
        $application->add($this->command);
        $command = $this->getApplication()->find($this->commandName);
        $this->roleModel->expects($this->once())->method('load')->with('invalid role', 'role_name')->will($this->returnValue($this->roleModel));
        $this->roleModel->expects($this->once())->method('getId')->will($this->returnValue(null));
        $commandTester = new CommandTester($command);
        $commandTester->execute(array('command' => $command->getName(), 'username' => 'aydin', 'firstname' => 'Aydin', 'lastname' => 'Hassan', 'email' => '[email protected]', 'password' => 'p4ssw0rd', 'role' => 'invalid role'));
        $this->assertContains('Role was not found', $commandTester->getDisplay());
    }