ConfigTest.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Quote\Test\Unit\Model\Quote;
  7. class ConfigTest extends \PHPUnit\Framework\TestCase
  8. {
  9. /**
  10. * @var \Magento\Quote\Model\Quote\Config
  11. */
  12. protected $_model;
  13. /**
  14. * @var \PHPUnit_Framework_MockObject_MockObject
  15. */
  16. protected $_attributeConfig;
  17. protected function setUp()
  18. {
  19. $this->_attributeConfig = $this->createMock(\Magento\Catalog\Model\Attribute\Config::class);
  20. $this->_model = new \Magento\Quote\Model\Quote\Config($this->_attributeConfig);
  21. }
  22. public function testGetProductAttributes()
  23. {
  24. $attributes = ['attribute_one', 'attribute_two'];
  25. $this->_attributeConfig->expects(
  26. $this->once()
  27. )->method(
  28. 'getAttributeNames'
  29. )->with(
  30. 'quote_item'
  31. )->will(
  32. $this->returnValue($attributes)
  33. );
  34. $this->assertEquals($attributes, $this->_model->getProductAttributes());
  35. }
  36. }