commandDeleteTest.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. require_once __DIR__ . '/../vendor/autoload.php';
  3. class commandDeleteTest extends \PHPUnit\Framework\TestCase
  4. {
  5. public function testUser(): void
  6. {
  7. $command = new \ProfiCloS\VestaCP\Command\Delete\User('admin');
  8. $this->assertSame('v-delete-user', $command->getName());
  9. $this->assertSame(['arg1' => 'admin'], $command->getRequestParams());
  10. $this->assertTrue($command->needReturnCode());
  11. }
  12. public function testWebDomain(): void
  13. {
  14. $command = new \ProfiCloS\VestaCP\Command\Delete\WebDomain('admin', 'domain.com');
  15. $this->assertSame('v-delete-web-domain', $command->getName());
  16. $this->assertSame([
  17. 'arg1' => 'admin',
  18. 'arg2' => 'domain.com'
  19. ], $command->getRequestParams());
  20. }
  21. public function testWebDomainFtp(): void
  22. {
  23. $command = new \ProfiCloS\VestaCP\Command\Delete\WebDomainFtp('admin', 'domain.com', 'account');
  24. $this->assertSame('v-delete-web-domain-ftp', $command->getName());
  25. $this->assertSame([
  26. 'arg1' => 'admin',
  27. 'arg2' => 'domain.com',
  28. 'arg3' => 'account'
  29. ], $command->getRequestParams());
  30. }
  31. public function testLEDomain(): void
  32. {
  33. $command = new \ProfiCloS\VestaCP\Command\Delete\LetsEncryptDomain('admin', 'domain.com');
  34. $this->assertSame('v-delete-letsencrypt-domain', $command->getName());
  35. $this->assertSame([
  36. 'arg1' => 'admin',
  37. 'arg2' => 'domain.com',
  38. 'arg3' => 'no'
  39. ], $command->getRequestParams());
  40. }
  41. public function testMailAccount(): void
  42. {
  43. $command = new \ProfiCloS\VestaCP\Command\Delete\MailAccount('admin', 'domain.com', 'account');
  44. $this->assertSame('v-delete-mail-account', $command->getName());
  45. $this->assertSame([
  46. 'arg1' => 'admin',
  47. 'arg2' => 'domain.com',
  48. 'arg3' => 'account'
  49. ], $command->getRequestParams());
  50. }
  51. public function testMailDomain(): void
  52. {
  53. $command = new \ProfiCloS\VestaCP\Command\Delete\MailDomain('admin', 'domain.com');
  54. $this->assertSame('v-delete-mail-domain', $command->getName());
  55. $this->assertSame([
  56. 'arg1' => 'admin',
  57. 'arg2' => 'domain.com'
  58. ], $command->getRequestParams());
  59. }
  60. }