/** * @return CollectionFactory|\PHPUnit_Framework_MockObject_MockObject */ protected function getCustomerCollectionFactoryMock() { $collectionMock = $this->getMockBuilder('Magento\\Customer\\Model\\Resource\\Customer\\Collection')->disableOriginalConstructor()->getMock(); $collectionMock->expects($this->once())->method('addAttributeToSelect')->with('*'); $this->customerCollectionFactoryMock->expects($this->once())->method('create')->willReturn($collectionMock); return $this->customerCollectionFactoryMock; }