/**
  * Test export method
  *
  * @magentoDataFixture Magento/Customer/_files/import_export/customers.php
  */
 public function testExport()
 {
     $expectedAttributes = array();
     /** @var $collection \Magento\Customer\Model\Resource\Attribute\Collection */
     $collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Customer\\Model\\Resource\\Attribute\\Collection');
     /** @var $attribute \Magento\Customer\Model\Attribute */
     foreach ($collection as $attribute) {
         $expectedAttributes[] = $attribute->getAttributeCode();
     }
     $expectedAttributes = array_diff($expectedAttributes, $this->_model->getDisabledAttributes());
     $this->_model->setWriter(\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\ImportExport\\Model\\Export\\Adapter\\Csv'));
     $data = $this->_model->export();
     $this->assertNotEmpty($data);
     $lines = $this->_csvToArray($data, 'email');
     $this->assertEquals(count($expectedAttributes), count(array_intersect($expectedAttributes, $lines['header'])), 'Expected attribute codes were not exported');
     $this->assertNotEmpty($lines['data'], 'No data was exported');
     /** @var $objectManager \Magento\TestFramework\ObjectManager */
     $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
     /** @var $customers \Magento\Customer\Model\Customer[] */
     $customers = $objectManager->get('Magento\\Framework\\Registry')->registry('_fixture/Magento_ImportExport_Customer_Collection');
     foreach ($customers as $key => $customer) {
         foreach ($expectedAttributes as $code) {
             if (!in_array($code, $this->_model->getDisabledAttributes()) && isset($lines[$key][$code])) {
                 $this->assertEquals($customer->getData($code), $lines[$key][$code], 'Attribute "' . $code . '" is not equal');
             }
         }
     }
 }