<commit_before><?php

/*
 * This file is part of the Elcodi package.
 *
 * Copyright (c) 2014-2016 Elcodi Networks S.L.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * Feel free to edit as you please, and have fun.
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author Elcodi Team <<EMAIL>>
 */

namespace Elcodi\Component\Banner\Tests\UnitTest\Entity;

use Elcodi\Component\Banner\Entity\BannerZone;
use Elcodi\Component\Core\Tests\UnitTest\Entity\AbstractEntityTest;

/**
 * Class BannerZoneTest.
 */
class BannerZoneTest extends AbstractEntityTest
{
    /**
     * Return the entity namespace.
     *
     * @return string Entity namespace
     */
    public function getEntityNamespace()
    {
        return 'Elcodi\Component\Banner\Entity\BannerZone';
    }

    /**
     * Return the fields to test in entities.
     *
     * [
     *      [[
     *          "type" => $this::GETTER_SETTER,
     *          "getter" => "getValue",
     *          "setter" => "setValue",
     *          "value" => "Elcodi\Component\...\Interfaces\AnInterface"
     *          "nullable" => true
     *      ]],
     *      [[
     *          "type" => $this::ADDER_REMOVER|$this::ADDER_REMOVER,
     *          "getter" => "getValue",
     *          "setter" => "setValue",
     *          "adder" => "addValue",
     *          "removed" => "removeValue",
     *          "bag" => "collection", // can be array
     *          "value" => "Elcodi\Component\...\Interfaces\AnInterface"
     *      ]]
     * ]
     *
     * @return array Fields
     */
    public function getTestableFields()
    {
        return [
            [[
                'type' => $this::GETTER_SETTER,
                'getter' => 'getName',
                'setter' => 'setName',
                'value' => sha1(mt_rand()),
                'nullable' => false,
            ]],
            [[
                'type' => $this::GETTER_SETTER,
                'getter' => 'getCode',
                'setter' => 'setCode',
                'value' => sha1(mt_rand()),
                'nullable' => false,
            ]],
            [[
                'type' => $this::GETTER_SETTER,
                'getter' => 'getLanguage',
                'setter' => 'setLanguage',
                'value' => $this->getMock('Elcodi\Component\Language\Entity\Interfaces\LanguageInterface'),
                'nullable' => false,
            ]],
            [[
                'type' => $this::ADDER_REMOVER,
                'getter' => 'getBanners',
                'setter' => 'setBanners',
                'adder' => 'addBanner',
                'remover' => 'removeBanner',
                'bag' => '\Doctrine\Common\Collections\ArrayCollection',
                'value' => '\Elcodi\Component\Banner\Entity\Interfaces\BannerInterface',
            ]],
            [[
                'type' => $this::GETTER_SETTER,
                'getter' => 'getHeight',
                'setter' => 'setHeight',
                'value' => microtime(true),
                'nullable' => false,
            ]],
            [[
                'type' => $this::GETTER_SETTER,
                'getter' => 'getWidth',
                'setter' => 'setWidth',
                'value' => microtime(true),
                'nullable' => false,
            ]],
        ];
    }

    /**
     * Test the string casting.<commit_msg>Fixed banner test<commit_after><?php

/*
 * This file is part of the Elcodi package.
 *
 * Copyright (c) 2014-2016 Elcodi Networks S.L.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * Feel free to edit as you please, and have fun.
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @author Elcodi Team <<EMAIL>>
 */

namespace Elcodi\Component\Banner\Tests\UnitTest\Entity;

use Elcodi\Component\Banner\Entity\BannerZone;
use Elcodi\Component\Core\Tests\UnitTest\Entity\AbstractEntityTest;

/**
 * Class BannerZoneTest.
 */
class BannerZoneTest extends AbstractEntityTest
{
    /**
     * Return the entity namespace.
     *
     * @return string Entity namespace
     */
    public function getEntityNamespace()
    {
        return 'Elcodi\Component\Banner\Entity\BannerZone';
    }

    /**
     * Return the fields to test in entities.
     *
     * [
     *      [[
     *          "type" => $this::GETTER_SETTER,
     *          "getter" => "getValue",
     *          "setter" => "setValue",
     *          "value" => "Elcodi\Component\...\Interfaces\AnInterface"
     *          "nullable" => true
     *      ]],
     *      [[
     *          "type" => $this::ADDER_REMOVER|$this::ADDER_REMOVER,
     *          "getter" => "getValue",
     *          "setter" => "setValue",
     *          "adder" => "addValue",
     *          "removed" => "removeValue",
     *          "bag" => "collection", // can be array
     *          "value" => "Elcodi\Component\...\Interfaces\AnInterface"
     *      ]]
     * ]
     *
     * @return array Fields
     */
    public function getTestableFields()
    {
        return [
            [[
                'type' => $this::GETTER_SETTER,
                'getter' => 'getName',
                'setter' => 'setName',
                'value' => sha1(mt_rand()),
                'nullable' => false,
            ]],
            [[
                'type' => $this::GETTER_SETTER,
                'getter' => 'getCode',
                'setter' => 'setCode',
                'value' => sha1(mt_rand()),
                'nullable' => false,
            ]],
            [[
                'type' => $this::GETTER_SETTER,
                'getter' => 'getLanguage',
                'setter' => 'setLanguage',
                'value' => '\Elcodi\Component\Language\Entity\Interfaces\LanguageInterface',
                'nullable' => false,
            ]],
            [[
                'type' => $this::ADDER_REMOVER,
                'getter' => 'getBanners',
                'setter' => 'setBanners',
                'adder' => 'addBanner',
                'remover' => 'removeBanner',
                'bag' => '\Doctrine\Common\Collections\ArrayCollection',
                'value' => '\Elcodi\Component\Banner\Entity\Interfaces\BannerInterface',
            ]],
            [[
                'type' => $this::GETTER_SETTER,
                'getter' => 'getHeight',
                'setter' => 'setHeight',
                'value' => microtime(true),
                'nullable' => false,
            ]],
            [[
                'type' => $this::GETTER_SETTER,
                'getter' => 'getWidth',
                'setter' => 'setWidth',
                'value' => microtime(true),
                'nullable' => false,
            ]],
        ];
    }

    /**
     * Test the string casting.
{'fraction_non_alphanumeric': 0.15119478638667633, 'fraction_numerical': 0.002896451846488052, 'mean_word_length': 1.499457111834962, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 108, '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': '3403485', 'n_tokens_mistral': 2074, 'n_tokens_neox': 1962, 'n_words': 377}