UpgradeHashAlgorithmCommandTest.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Customer\Test\Unit\Console\Command;
  7. use Magento\Customer\Console\Command\UpgradeHashAlgorithmCommand;
  8. use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
  9. use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory;
  10. class UpgradeHashAlgorithmCommandTest extends \PHPUnit\Framework\TestCase
  11. {
  12. /**
  13. * @var UpgradeHashAlgorithmCommand
  14. */
  15. private $command;
  16. /**
  17. * @var ObjectManager
  18. */
  19. private $objectManager;
  20. /**
  21. * @var CollectionFactory|\PHPUnit_Framework_MockObject_MockObject
  22. */
  23. private $customerCollectionFactory;
  24. protected function setUp()
  25. {
  26. $this->customerCollectionFactory = $this->getMockBuilder(
  27. \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory::class
  28. )->setMethods(['create'])
  29. ->disableOriginalConstructor()
  30. ->getMock();
  31. $this->objectManager = new ObjectManager($this);
  32. $this->command = $this->objectManager->getObject(
  33. \Magento\Customer\Console\Command\UpgradeHashAlgorithmCommand::class,
  34. [
  35. 'customerCollectionFactory' => $this->customerCollectionFactory
  36. ]
  37. );
  38. }
  39. public function testConfigure()
  40. {
  41. $this->assertEquals('customer:hash:upgrade', $this->command->getName());
  42. $this->assertEquals(
  43. 'Upgrade customer\'s hash according to the latest algorithm',
  44. $this->command->getDescription()
  45. );
  46. }
  47. }