public function testAddProductWithoutSession() { /** @var $product \Magento\Catalog\Model\Product */ $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Catalog\\Model\\Product')->load(1); $this->_model->addProduct($product); $this->assertFalse($this->_model->hasItems(1, $this->_visitor->getId())); $this->assertTrue($this->_model->hasItems(0, $this->_visitor->getId())); }