<commit_before><?php

namespace Doctrine\Tests\ORM\Cache\Persister;

use Doctrine\Tests\OrmTestCase;

use Doctrine\ORM\Cache\Region;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Persisters\CollectionPersister;

use Doctrine\Tests\Models\Cache\State;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * @group DDC-2183
 */
abstract class AbstractCollectionPersisterTest extends OrmTestCase
{
    /**
     * @var \Doctrine\ORM\Cache\Region
     */
    protected $region;

    /**
     * @var \Doctrine\ORM\Persisters\CollectionPersister
     */
    protected $collectionPersister;

    /**
     * @var \Doctrine\ORM\EntityManager
     */
    protected $em;

    /**
     * @var array
     */
    protected $regionMockMethods = array(
        'getName',
        'contains',
        'get',
        'put',
        'evict',
        'evictAll'
    );

    /**
     * @var array
     */
    protected $collectionPersisterMockMethods = array(
        'delete',
        'update',
        'deleteRows',
        'insertRows',
        'count',
        'slice',
        'contains',
        'containsKey',
        'removeElement',
        'removeKey',
        'get',
    );

    /**
     * @param \Doctrine\ORM\EntityManager                   $em
     * @param \Doctrine\ORM\Persisters\CollectionPersister  $persister
     * @param \Doctrine\ORM\Cache\Region                    $region
     * @param array                                         $mapping
     *
     * @return Doctrine\ORM\Cache\Persister\AbstractCollectionPersister
     */
    abstract protected function createPersister(EntityManager $em, CollectionPersister $persister, Region $region, array $mapping);

    protected function setUp()
    {
        $this->getSharedSecondLevelCacheDriverImpl()->flushAll();
        $this->enableSecondLevelCache();
        parent::setUp();

        $this->em                   = $this->_getTestEntityManager();
        $this->region               = $this->createRegion();
        $this->collectionPersister  = $this->getMock('Doctrine\ORM\Persisters\CollectionPersister', $this->collectionPersisterMockMethods);<commit_msg>Fix test<commit_after><?php

namespace Doctrine\Tests\ORM\Cache\Persister;

use Doctrine\Tests\OrmTestCase;

use Doctrine\ORM\Cache\Region;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Persisters\CollectionPersister;

use Doctrine\Tests\Models\Cache\State;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * @group DDC-2183
 */
abstract class AbstractCollectionPersisterTest extends OrmTestCase
{
    /**
     * @var \Doctrine\ORM\Cache\Region
     */
    protected $region;

    /**
     * @var \Doctrine\ORM\Persisters\CollectionPersister
     */
    protected $collectionPersister;

    /**
     * @var \Doctrine\ORM\EntityManager
     */
    protected $em;

    /**
     * @var array
     */
    protected $regionMockMethods = array(
        'getName',
        'contains',
        'get',
        'put',
        'evict',
        'evictAll'
    );

    /**
     * @var array
     */
    protected $collectionPersisterMockMethods = array(
        'delete',
        'update',
        'deleteRows',
        'insertRows',
        'count',
        'slice',
        'contains',
        'containsKey',
        'removeElement',
        'removeKey',
        'get',
        'loadCriteria'
    );

    /**
     * @param \Doctrine\ORM\EntityManager                   $em
     * @param \Doctrine\ORM\Persisters\CollectionPersister  $persister
     * @param \Doctrine\ORM\Cache\Region                    $region
     * @param array                                         $mapping
     *
     * @return Doctrine\ORM\Cache\Persister\AbstractCollectionPersister
     */
    abstract protected function createPersister(EntityManager $em, CollectionPersister $persister, Region $region, array $mapping);

    protected function setUp()
    {
        $this->getSharedSecondLevelCacheDriverImpl()->flushAll();
        $this->enableSecondLevelCache();
        parent::setUp();

        $this->em                   = $this->_getTestEntityManager();
        $this->region               = $this->createRegion();
        $this->collectionPersister  = $this->getMock('Doctrine\ORM\Persisters\CollectionPersister', $this->collectionPersisterMockMethods);
{'fraction_non_alphanumeric': 0.12347417840375587, 'fraction_numerical': 0.0018779342723004694, 'mean_word_length': 2.172747580044676, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2373183', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1179, 'n_words': 199}