Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ValidatorFileMock.php
Go to the documentation of this file.
1 <?php
7 
9 
13 class ValidatorFileMock extends \PHPUnit\Framework\TestCase
14 {
20  public function getInstance()
21  {
22  $userValue = [
23  'type' => 'image/jpeg',
24  'title' => "test.jpg",
25  'quote_path' => "custom_options/quote/s/t/4624d2.jpg",
26  'order_path' => "custom_options/order/s/t/89d25b4624d2.jpg",
27  "fullpath" => "pub/media/custom_options/quote/s/t/e47389d25b4624d2.jpg",
28  "size"=> "71901",
29  "width" => 5,
30  "height" => 5,
31  "secret_key" => "10839ec1631b77e5e473",
32  ];
33  $instance = $this->getMockBuilder(ValidatorFile::class)
34  ->disableOriginalConstructor()
35  ->getMock();
36  $instance->method('SetProduct')->willReturnSelf();
37  $instance->method('validate')->willReturn($userValue);
38 
39  return $instance;
40  }
41 }