Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AdminAccountFactoryTest.php
Go to the documentation of this file.
1 <?php
8 
9 use \Magento\Setup\Model\AdminAccountFactory;
10 
11 class AdminAccountFactoryTest extends \PHPUnit\Framework\TestCase
12 {
13  public function testCreate()
14  {
15  $serviceLocatorMock =
16  $this->getMockForAbstractClass(\Zend\ServiceManager\ServiceLocatorInterface::class, ['get']);
17  $serviceLocatorMock
18  ->expects($this->once())
19  ->method('get')
20  ->with(\Magento\Framework\Encryption\Encryptor::class)
21  ->willReturn($this->getMockForAbstractClass(\Magento\Framework\Encryption\EncryptorInterface::class));
22  $adminAccountFactory = new AdminAccountFactory($serviceLocatorMock);
23  $adminAccount = $adminAccountFactory->create(
24  $this->getMockForAbstractClass(\Magento\Framework\DB\Adapter\AdapterInterface::class),
25  []
26  );
27  $this->assertInstanceOf(\Magento\Setup\Model\AdminAccount::class, $adminAccount);
28  }
29 }