/**
  * @magentoDataFixture Magento/Catalog/Model/Resource/_files/product_simple.php
  */
 public function testAddTierPriceData()
 {
     $this->_collection->setFlag('tier_price_added', false);
     $this->_collection->addIdFilter(2);
     $this->assertInstanceOf('\\Magento\\Catalog\\Model\\Resource\\Product\\Collection', $this->_collection->addTierPriceData());
     $tierPrice = $this->_collection->getFirstItem()->getDataByKey('tier_price');
     $this->assertEquals($this->_groupManagement->getNotLoggedInGroup()->getId(), current($tierPrice)['cust_group']);
     $this->assertEquals($this->_groupManagement->getAllCustomersGroup()->getId(), next($tierPrice)['cust_group']);
     $this->assertTrue($this->_collection->getFlag('tier_price_added'));
 }
Example #2
0
 /**
  * @magentoDataFixture Magento/Catalog/Model/Resource/_files/product_simple.php
  */
 public function testAddTierPriceData()
 {
     $this->_collection->setFlag('tier_price_added', false);
     $this->_collection->addIdFilter(2);
     $this->assertInstanceOf('\\Magento\\Catalog\\Model\\Resource\\Product\\Collection', $this->_collection->addTierPriceData());
     $tierPrice = $this->_collection->getFirstItem()->getDataByKey('tier_price');
     $this->assertEquals(CustomerGroupServiceInterface::NOT_LOGGED_IN_ID, current($tierPrice)['cust_group']);
     $this->assertEquals(CustomerGroupServiceInterface::CUST_GROUP_ALL, next($tierPrice)['cust_group']);
     $this->assertTrue($this->_collection->getFlag('tier_price_added'));
 }