for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Aimeos\Controller\Frontend\Basket\Decorator;
class BundleTest extends \PHPUnit_Framework_TestCase
{
private $object;
private $context;
protected function setUp()
$this->context = \TestHelperFrontend::getContext();
$object = new \Aimeos\Controller\Frontend\Basket\Standard( $this->context );
$this->object = new \Aimeos\Controller\Frontend\Basket\Decorator\Bundle( $object, $this->context );
}
protected function tearDown()
$this->object->clear();
$this->context->getSession()->set( 'aimeos', array() );
unset( $this->object );
public function testAddProductBundle()
$item = \Aimeos\MShop\Factory::createManager( $this->context, 'product' )->findItem( 'U:BUNDLE' );
$this->object->addProduct( $item->getId(), 1 );
$this->assertEquals( 1, count( $this->object->get()->getProducts() ) );
$this->assertEquals( 'U:BUNDLE', $this->object->get()->getProduct( 0 )->getProductCode() );
$this->assertEquals( 2, count( $this->object->get()->getProduct( 0 )->getProducts() ) );