Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TierPriceTypeTest.php
Go to the documentation of this file.
1 <?php
8 
9 use \Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing as AdvancedPricing;
10 
14 class TierPriceTypeTest extends \PHPUnit\Framework\TestCase
15 {
19  private $tierPriceType;
20 
26  protected function setUp()
27  {
28  $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
29  $this->tierPriceType = $objectManager->getObject(
30  AdvancedPricing\Validator\TierPriceType::class,
31  []
32  );
33  }
34 
42  public function testIsValid(array $value, $expectedResult)
43  {
44  $result = $this->tierPriceType->isValid($value);
45  $this->assertEquals($expectedResult, $result);
46  }
47 
53  public function isValidDataProvider()
54  {
55  return [
56  [
57  [AdvancedPricing::COL_TIER_PRICE_TYPE => AdvancedPricing::TIER_PRICE_TYPE_FIXED],
58  true
59  ],
60  [
61  [AdvancedPricing::COL_TIER_PRICE_TYPE => AdvancedPricing::TIER_PRICE_TYPE_PERCENT],
62  true
63  ],
64  [
65  [],
66  true
67  ],
68  [
69  [AdvancedPricing::COL_TIER_PRICE_TYPE => null],
70  true
71  ],
72  [
73  [AdvancedPricing::COL_TIER_PRICE_TYPE => 'wrong type'],
74  false
75  ]
76  ];
77  }
78 }
$objectManager
Definition: bootstrap.php:17
return false
Definition: gallery.phtml:36
$value
Definition: gender.phtml:16