Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ImageExtractorTest.php
Go to the documentation of this file.
1 <?php
7 
9 
10 class ImageExtractorTest extends \PHPUnit\Framework\TestCase
11 {
15  private $model;
16 
17  protected function setUp()
18  {
19  $objectManager = new ObjectManager($this);
20  $this->model = $objectManager->getObject(\Magento\Catalog\Model\ImageExtractor::class);
21  }
22 
23  public function testProcess()
24  {
25  $expectedArray = include(__DIR__ . '/_files/converted_view.php');
26  $this->assertSame($expectedArray, $this->model->process($this->getDomElement(), 'media'));
27  }
28 
34  private function getDomElement()
35  {
36  $doc = new \DOMDocument();
37  $doc->load(__DIR__ . '/_files/valid_view.xml');
38  return $doc->getElementsByTagName('images')->item(0);
39  }
40 }
$objectManager
Definition: bootstrap.php:17
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60