commandChangeTest.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. require_once __DIR__ . '/../vendor/autoload.php';
  3. class commandChangeTest extends \PHPUnit\Framework\TestCase
  4. {
  5. public function testUserPassword(): void
  6. {
  7. $command = new \ProfiCloS\VestaCP\Command\Change\UserPassword('admin', 'pass');
  8. $this->assertSame('v-change-user-password', $command->getName());
  9. $this->assertSame(['arg1' => 'admin', 'arg2' => 'pass'], $command->getRequestParams());
  10. $this->assertTrue($command->needReturnCode());
  11. }
  12. public function testMailAccountPassword(): void
  13. {
  14. $command = new \ProfiCloS\VestaCP\Command\Change\MailAccountPassword('admin', 'domain', 'account', 'pass');
  15. $this->assertSame('v-change-mail-account-password', $command->getName());
  16. $this->assertSame([
  17. 'arg1' => 'admin',
  18. 'arg2' => 'domain',
  19. 'arg3' => 'account',
  20. 'arg4' => 'pass'
  21. ], $command->getRequestParams());
  22. }
  23. public function testWebDomainFtpPassword(): void
  24. {
  25. $command = new \ProfiCloS\VestaCP\Command\Change\WebDomainFtpPassword('admin', 'domain', 'account', 'pass');
  26. $this->assertSame('v-change-web-domain-ftp-password', $command->getName());
  27. $this->assertSame([
  28. 'arg1' => 'admin',
  29. 'arg2' => 'domain',
  30. 'arg3' => 'account',
  31. 'arg4' => 'pass'
  32. ], $command->getRequestParams());
  33. }
  34. public function testWebDomainFtpPath(): void
  35. {
  36. $command = new \ProfiCloS\VestaCP\Command\Change\WebDomainFtpPath('admin', 'domain', 'account', 'path');
  37. $this->assertSame('v-change-web-domain-ftp-path', $command->getName());
  38. $this->assertSame([
  39. 'arg1' => 'admin',
  40. 'arg2' => 'domain',
  41. 'arg3' => 'account',
  42. 'arg4' => 'path'
  43. ], $command->getRequestParams());
  44. }
  45. }