<commit_before><?php

namespace Brera\MagentoConnector\Xml\Product;

class ProductMergeTest extends \PHPUnit_Framework_TestCase
{

    /**
     * @var ProductMerge
     */
    private $merge;

    protected function setUp()
    {
        $this->merge = new ProductMerge();
    }

    public function testEmptyXml()
    {
        $xml = $this->merge->getXmlString();

        $namespaces = [
            'xmlns="http://brera\.io"',
            'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"',
            'xsi:schemaLocation="http://brera.io ../../schema/catalog.xsd"',
        ];
        foreach ($namespaces as $ns) {
            $this->assertRegExp("#<catalog .*$ns.*>#Us", $xml);
        }
        $this->assertRegExp('#<products( |/>).*#', $xml);
    }

    public function testProductIsAdded()
    {
        $product = new \DOMDocument('1.0', 'utf-8');
        $node = $product->createElement('product', 'my product');
        $product->appendChild($node);

        $this->merge->addProduct(new ProductContainer($product));
        $xml = $this->merge->getXmlString();
        $this->assertContains('<product>my product</product>', $xml);
    }
}<commit_msg>Issue #2: Formatting<commit_after><?php

namespace Brera\MagentoConnector\Xml\Product;

class ProductMergeTest extends \PHPUnit_Framework_TestCase
{

    /**
     * @var ProductMerge
     */
    private $merge;

    public function testEmptyXml()
    {
        $xml = $this->merge->getXmlString();

        $namespaces = [
            'xmlns="http://brera\.io"',
            'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"',
            'xsi:schemaLocation="http://brera.io ../../schema/catalog.xsd"',
        ];
        foreach ($namespaces as $ns) {
            $this->assertRegExp("#<catalog .*$ns.*>#Us", $xml);
        }
        $this->assertRegExp('#<products( |/>).*#', $xml);
    }

    public function testProductIsAdded()
    {
        $product = new \DOMDocument('1.0', 'utf-8');
        $node = $product->createElement('product', 'my product');
        $product->appendChild($node);

        $this->merge->addProduct(new ProductContainer($product));
        $xml = $this->merge->getXmlString();
        $this->assertContains('<product>my product</product>', $xml);
    }

    protected function setUp()
    {
        $this->merge = new ProductMerge();
    }
}
{'fraction_non_alphanumeric': 0.18305661983822905, 'fraction_numerical': 0.007237122179650915, 'mean_word_length': 2.4609720176730487, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 14}, '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': '246184', 'n_tokens_mistral': 731, 'n_tokens_neox': 712, 'n_words': 112}