Example #1
0
 public function testIsArrayable()
 {
     $p = new Product();
     $p->setId(1);
     $p->setTitle('Domain registration');
     $p->setDescription('Domain registration');
     $this->assertInternalType('array', $p->toArray());
 }
Example #2
0
 public function testGetCartItem()
 {
     $term = new Term(1);
     $product = new Product();
     $product->getBilling()->addTerm($term);
     $productDomain = new ProductDomain();
     $productDomain->getBilling()->addTerm($term);
     $productSharedHosting = new ProductSharedHosting();
     $productSharedHosting->getBilling()->addTerm($term);
     $productCpanelHosting = new ProductCpanelHosting();
     $productCpanelHosting->getBilling()->addTerm($term);
     $productVps = new ProductVps();
     $productVps->getBilling()->addTerm($term);
     $productSsl = new ProductSsl();
     $productSsl->getBilling()->addTerm($term);
     $catalog = new Catalog();
     $this->assertInstanceOf('\\Cart\\CartItem', $catalog->getCartItem($productCpanelHosting));
     $this->assertInstanceOf('\\Cart\\CartItem', $catalog->getCartItem($productSsl));
     $this->assertInstanceOf('\\Cart\\CartItemVps', $catalog->getCartItem($productVps));
     $this->assertInstanceOf('\\Cart\\CartItemSharedHosting', $catalog->getCartItem($productSharedHosting));
     $this->assertInstanceOf('\\Cart\\CartItemDomain', $catalog->getCartItem($productDomain));
     $this->assertInstanceOf('\\Cart\\CartItem', $catalog->getCartItem($product));
 }
Example #3
0
 public function addProduct(Product $product)
 {
     $this->products[$product->getId()] = $product;
 }