Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
QuoteConfigurationTest.php
Go to the documentation of this file.
1 <?php
8 
12 class QuoteConfigurationTest extends \PHPUnit\Framework\TestCase
13 {
17  private $fixtureModelMock;
18 
22  private $fixture;
23 
27  public function setUp()
28  {
29  $this->fixtureModelMock = $this->getMockBuilder(\Magento\Setup\Fixtures\FixtureModel::class)
30  ->disableOriginalConstructor()
31  ->getMock();
32  $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
33 
34  $this->fixture = $objectManager->getObject(
35  \Magento\Setup\Fixtures\Quote\QuoteConfiguration::class,
36  [
37  'fixtureModel' => $this->fixtureModelMock
38  ]
39  );
40  }
41 
47  public function testLoad()
48  {
49  $dir = str_replace('Test/Unit/', '', dirname(__DIR__));
50  $expectedResult = [
51  'simple_count_to' => 1,
52  'simple_count_from' => 1,
53  'configurable_count_to' => 1,
54  'configurable_count_from' => 1,
55  'big_configurable_count_to' => 1,
56  'big_configurable_count_from' => 1,
57  'fixture_data_filename' =>
58  $dir . DIRECTORY_SEPARATOR . "_files" . DIRECTORY_SEPARATOR . 'orders_fixture_data.json',
59  'order_quotes_enable' => 1,
60  ];
61  $this->fixtureModelMock->expects($this->atLeastOnce())
62  ->method('getValue')
63  ->withConsecutive(
64  ['order_simple_product_count_to'],
65  ['order_simple_product_count_from'],
66  ['order_configurable_product_count_to'],
67  ['order_configurable_product_count_from'],
68  ['order_big_configurable_product_count_to'],
69  ['order_big_configurable_product_count_from'],
70  ['order_quotes_enable',]
71  )->willReturn(1);
72  $this->assertSame($expectedResult, $this->fixture->load()->getData());
73  }
74 }
$objectManager
Definition: bootstrap.php:17
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60