<commit_before><?php

namespace Vespolina\CartBundle\Tests\Service;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Vespolina\CartBundle\Model\Cart;
use Vespolina\CartBundle\Model\CartItem;
use Vespolina\MerchandiseBundle\Model\Merchandise;


class CartCreateTest extends WebTestCase
{
    protected $client;

    public function setUp()
    {
        $this->client = $this->createClient();
    }

    public function getKernel(array $options = array())
    {
        if (!$this->kernel) {
            $this->kernel = $this->createKernel($options);
            $this->kernel->boot();
        }

        return $this->kernel;
    }

    public function testCreateCart()
    {
        $cartService = $this->getKernel()->getContainer()->get('vespolina.cart');

        $cart = $cartService->createCart();
        $cart->setOwner(array('name' => '<NAME>'));
        
        $cartItem1 = $cartService->createItem($cart);
        $cartItem1->setQuantity(10);

        $merchandise1 = new Merchandise();
        $cartItem1->setMerchandiseOption('color', 'red');<commit_msg>Updated tests to work in symfony 2.0<commit_after><?php

namespace Vespolina\CartBundle\Tests\Service;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Vespolina\CartBundle\Model\Cart;
use Vespolina\CartBundle\Model\CartItem;
use Vespolina\MerchandiseBundle\Model\Merchandise;


class CartCreateTest extends WebTestCase
{
    protected $client;

    public function setUp()
    {
        $this->client = $this->createClient();
    }

    public function getKernel(array $options = array())
    {
        if (!self::$kernel) {
            self::$kernel = $this->createKernel($options);
            self::$kernel->boot();
        }

        return self::$kernel;
    }

    public function testCreateCart()
    {
        $cartService = $this->getKernel()->getContainer()->get('vespolina.cart');

        $cart = $cartService->createCart();
        $cart->setOwner(array('name' => '<NAME>'));
        
        $cartItem1 = $cartService->createItem($cart);
        $cartItem1->setQuantity(10);

        $merchandise1 = new Merchandise();
        $cartItem1->setMerchandiseOption('color', 'red');
{'fraction_non_alphanumeric': 0.1465319246669729, 'fraction_numerical': 0.006430868167202572, 'mean_word_length': 3.0634328358208953, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2991820', 'n_tokens_mistral': 670, 'n_tokens_neox': 649, 'n_words': 107}