diff --git a/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/AddressTest.php b/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/AddressTest.php index 21622c938d081..20625d9d7f999 100644 --- a/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/AddressTest.php +++ b/app/code/Magento/CustomerImportExport/Test/Unit/Model/Import/AddressTest.php @@ -8,6 +8,12 @@ use Magento\CustomerImportExport\Model\Import\Address; use Magento\ImportExport\Model\Import\AbstractEntity; +use Magento\Framework\DB\Select; +use Magento\Framework\DB\Adapter\AdapterInterface; +use Magento\Customer\Model\ResourceModel\Customer\Collection; +use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory; +use Magento\ImportExport\Model\ResourceModel\CollectionByPagesIteratorFactory; +use Magento\CustomerImportExport\Model\ResourceModel\Import\Customer\Storage; /** * Class AddressTest @@ -233,14 +239,14 @@ protected function _createAttrCollectionMock() */ protected function _createCustomerStorageMock() { - /** @var \Magento\Framework\DB\Select|\PHPUnit_Framework_MockObject_MockObject $selectMock */ - $selectMock = $this->getMockBuilder(\Magento\Framework\DB\Select::class) + /** @var Select|\PHPUnit_Framework_MockObject_MockObject $selectMock */ + $selectMock = $this->getMockBuilder(Select::class) ->disableOriginalConstructor() ->setMethods(['from']) ->getMock(); $selectMock->expects($this->any())->method('from')->will($this->returnSelf()); - /** @var $connectionMock \Magento\Framework\DB\Adapter\AdapterInterface|\PHPUnit_Framework_MockObject_MockObject */ + /** @var $connectionMock AdapterInterface|\PHPUnit_Framework_MockObject_MockObject */ $connectionMock = $this->getMockBuilder(\Magento\Framework\DB\Adapter\Pdo\Mysql::class) ->disableOriginalConstructor() ->setMethods(['select', 'fetchAll']) @@ -249,8 +255,8 @@ protected function _createCustomerStorageMock() ->method('select') ->will($this->returnValue($selectMock)); - /** @var \Magento\Customer\Model\ResourceModel\Customer\Collection|\PHPUnit_Framework_MockObject_MockObject $customerCollection */ - $customerCollection = $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\Collection::class) + /** @var Collection|\PHPUnit_Framework_MockObject_MockObject $customerCollection */ + $customerCollection = $this->getMockBuilder(Collection::class) ->disableOriginalConstructor() ->setMethods(['getConnection']) ->getMock(); @@ -258,8 +264,8 @@ protected function _createCustomerStorageMock() ->method('getConnection') ->will($this->returnValue($connectionMock)); - /** @var \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory|\PHPUnit_Framework_MockObject_MockObject $collectionFactory */ - $collectionFactory = $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\CollectionFactory::class) + /** @var CollectionFactory|\PHPUnit_Framework_MockObject_MockObject $collectionFactory */ + $collectionFactory = $this->getMockBuilder(CollectionFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); @@ -267,14 +273,14 @@ protected function _createCustomerStorageMock() ->method('create') ->willReturn($customerCollection); - /** @var \Magento\ImportExport\Model\ResourceModel\CollectionByPagesIteratorFactory|\PHPUnit_Framework_MockObject_MockObject $byPagesIteratorFactory */ - $byPagesIteratorFactory = $this->getMockBuilder(\Magento\ImportExport\Model\ResourceModel\CollectionByPagesIteratorFactory::class) + /** @var CollectionByPagesIteratorFactory|\PHPUnit_Framework_MockObject_MockObject $byPagesIteratorFactory */ + $byPagesIteratorFactory = $this->getMockBuilder(CollectionByPagesIteratorFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - /** @var \Magento\CustomerImportExport\Model\ResourceModel\Import\Customer\Storage|\PHPUnit_Framework_MockObject_MockObject $customerStorage */ - $customerStorage = $this->getMockBuilder(\Magento\CustomerImportExport\Model\ResourceModel\Import\Customer\Storage::class) + /** @var Storage|\PHPUnit_Framework_MockObject_MockObject $customerStorage */ + $customerStorage = $this->getMockBuilder(Storage::class) ->setMethods(['load']) ->setConstructorArgs([$collectionFactory, $byPagesIteratorFactory]) ->getMock(); diff --git a/app/code/Magento/CustomerImportExport/Test/Unit/Model/ResourceModel/Import/Customer/StorageTest.php b/app/code/Magento/CustomerImportExport/Test/Unit/Model/ResourceModel/Import/Customer/StorageTest.php index 018c7b932a8c7..9a06ebae375a6 100644 --- a/app/code/Magento/CustomerImportExport/Test/Unit/Model/ResourceModel/Import/Customer/StorageTest.php +++ b/app/code/Magento/CustomerImportExport/Test/Unit/Model/ResourceModel/Import/Customer/StorageTest.php @@ -6,6 +6,10 @@ namespace Magento\CustomerImportExport\Test\Unit\Model\ResourceModel\Import\Customer; use Magento\CustomerImportExport\Model\ResourceModel\Import\Customer\Storage; +use Magento\Framework\DB\Adapter\AdapterInterface; +use Magento\Customer\Model\ResourceModel\Customer\Collection; +use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory; +use Magento\ImportExport\Model\ResourceModel\CollectionByPagesIteratorFactory; class StorageTest extends \PHPUnit\Framework\TestCase { @@ -33,7 +37,7 @@ protected function setUp() ->getMock(); $selectMock->expects($this->any())->method('from')->will($this->returnSelf()); - /** @var $connectionMock \Magento\Framework\DB\Adapter\AdapterInterface|\PHPUnit_Framework_MockObject_MockObject */ + /** @var $connectionMock AdapterInterface|\PHPUnit_Framework_MockObject_MockObject */ $connectionMock = $this->getMockBuilder(\Magento\Framework\DB\Adapter\Pdo\Mysql::class) ->disableOriginalConstructor() ->setMethods(['select', 'fetchAll']) @@ -45,8 +49,8 @@ protected function setUp() ->method('fetchAll') ->will($this->returnValue([])); - /** @var \Magento\Customer\Model\ResourceModel\Customer\Collection|\PHPUnit_Framework_MockObject_MockObject $customerCollection */ - $customerCollection = $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\Collection::class) + /** @var Collection|\PHPUnit_Framework_MockObject_MockObject $customerCollection */ + $customerCollection = $this->getMockBuilder(Collection::class) ->disableOriginalConstructor() ->setMethods(['getConnection','getMainTable']) ->getMock(); @@ -58,8 +62,8 @@ protected function setUp() ->method('getMainTable') ->willReturn('customer_entity'); - /** @var \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory|\PHPUnit_Framework_MockObject_MockObject $collectionFactory */ - $collectionFactory = $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\CollectionFactory::class) + /** @var CollectionFactory|\PHPUnit_Framework_MockObject_MockObject $collectionFactory */ + $collectionFactory = $this->getMockBuilder(CollectionFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); @@ -67,13 +71,13 @@ protected function setUp() ->method('create') ->willReturn($customerCollection); - /** @var \Magento\ImportExport\Model\ResourceModel\CollectionByPagesIteratorFactory|\PHPUnit_Framework_MockObject_MockObject $byPagesIteratorFactory */ - $byPagesIteratorFactory = $this->getMockBuilder(\Magento\ImportExport\Model\ResourceModel\CollectionByPagesIteratorFactory::class) + /** @var CollectionByPagesIteratorFactory|\PHPUnit_Framework_MockObject_MockObject $byPagesIteratorFactory */ + $byPagesIteratorFactory = $this->getMockBuilder(CollectionByPagesIteratorFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->_model = new \Magento\CustomerImportExport\Model\ResourceModel\Import\Customer\Storage( + $this->_model = new Storage( $collectionFactory, $byPagesIteratorFactory );