PoolTest.php 835 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\SalesRule\Test\Unit\Model\Validator;
  7. /**
  8. * Test Class PoolTest
  9. */
  10. class PoolTest extends \PHPUnit\Framework\TestCase
  11. {
  12. /**
  13. * @var \Magento\SalesRule\Model\Validator\Pool;
  14. */
  15. protected $pool;
  16. /**
  17. * @var array
  18. */
  19. protected $validators = [];
  20. protected function setUp()
  21. {
  22. $this->validators = ['discount' => ['validator1', 'validator2']];
  23. $this->pool = new \Magento\SalesRule\Model\Validator\Pool($this->validators);
  24. }
  25. public function testGetValidators()
  26. {
  27. $this->assertContains($this->validators['discount'][0], $this->pool->getValidators('discount'));
  28. $this->assertEquals([], $this->pool->getValidators('fake'));
  29. }
  30. }