Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FileInfoTest.php
Go to the documentation of this file.
1 <?php
7 
10 
11 class FileInfoTest extends \PHPUnit\Framework\TestCase
12 {
16  private $objectManagerHelper;
17 
21  protected function setUp()
22  {
23  $this->objectManagerHelper = new ObjectManagerHelper($this);
24  }
25 
32  public function testConstruct($path, $initializationVector)
33  {
34  $constructorArguments = [
35  'path' => $path,
36  'initializationVector' => $initializationVector,
37  ];
39  $fileInfo = $this->objectManagerHelper->getObject(
40  FileInfo::class,
41  array_filter($constructorArguments)
42  );
43 
44  $this->assertSame($path ?: '', $fileInfo->getPath());
45  $this->assertSame($initializationVector ?: '', $fileInfo->getInitializationVector());
46  }
47 
51  public function constructDataProvider()
52  {
53  return [
54  'Degenerate object' => [null, null],
55  'Without Initialization Vector' => ['content text', null],
56  'With Initialization Vector' => ['content text', 'c51sd3c4sd68c5sd'],
57  ];
58  }
59 }