<commit_before><?php
/*
 * (c) 2011 SimpleThings GmbH
 *
 * @package SimpleThings\EntityAudit
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @link http://www.simplethings.de
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

namespace SimpleThings\EntityAudit\Tests;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\SoftDeleteable\SoftDeleteableListener;
use Gedmo\Version;

class IssueTest extends BaseTest
{
    protected $schemaEntities = array(
        'SimpleThings\EntityAudit\Tests\EscapedColumnsEntity',
        'SimpleThings\EntityAudit\Tests\Issue87Project',
        'SimpleThings\EntityAudit\Tests\Issue87ProjectComment',
        'SimpleThings\EntityAudit\Tests\Issue87AbstractProject',
        'SimpleThings\EntityAudit\Tests\Issue87Organization',
        'SimpleThings\EntityAudit\Tests\Issue9Address',
        'SimpleThings\EntityAudit\Tests\Issue9Customer',
        'SimpleThings\EntityAudit\Tests\Issue87Organization',
        'SimpleThings\EntityAudit\Tests\DuplicateRevisionFailureTestPrimaryOwner',
        'SimpleThings\EntityAudit\Tests\DuplicateRevisionFailureTestSecondaryOwner',
        'SimpleThings\EntityAudit\Tests\DuplicateRevisionFailureTestOwnedElement',
        'SimpleThings\EntityAudit\Tests\Issue111Entity',
    );

    protected $auditedEntities = array(
        'SimpleThings\EntityAudit\Tests\EscapedColumnsEntity',
        'SimpleThings\EntityAudit\Tests\Issue87Project',
        'SimpleThings\EntityAudit\Tests\Issue87ProjectComment',
        'SimpleThings\EntityAudit\Tests\Issue87AbstractProject',
        'SimpleThings\EntityAudit\Tests\Issue87Organization',
        'SimpleThings\EntityAudit\Tests\Issue9Address',
        'SimpleThings\EntityAudit\Tests\Issue9Customer',
        'SimpleThings\EntityAudit\Tests\Issue87Organization',
        'SimpleThings\EntityAudit\Tests\DuplicateRevisionFailureTestPrimaryOwner',
        'SimpleThings\EntityAudit\Tests\DuplicateRevisionFailureTestSecondaryOwner',
        'SimpleThings\EntityAudit\Tests\DuplicateRevisionFailureTestOwnedElement',
        'SimpleThings\EntityAudit\Tests\Issue111Entity',
    );

    public function setUp()
    {
        //softdeleteable is present only in gedmo's 2.3+
        if (version_compare(Version::VERSION, '2.3') < 0) {
            $this->auditedEntities = array_diff($this->auditedEntities, array('SimpleThings\EntityAudit\Tests\Issue111Entity'));
            $this->schemaEntities = array_diff($this->schemaEntities, array('SimpleThings\EntityAudit\Tests\Issue111Entity'));
        }

        parent::setUp();
    }

    public function testIssue111()
    {
        if (version_compare(Version::VERSION, '2.3') < 0) {
            $this->markTestSkipped('SoftDeleteable is available only since gedmo 2.3');
        }

        $this->em->getEventManager()->addEventSubscriber(new SoftDeleteableListener());
<commit_msg>adapring gedmo versioning changes<commit_after><?php
/*
 * (c) 2011 SimpleThings GmbH
 *
 * @package SimpleThings\EntityAudit
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @link http://www.simplethings.de
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

namespace SimpleThings\EntityAudit\Tests;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;

class IssueTest extends BaseTest
{
    protected $schemaEntities = array(
        'SimpleThings\EntityAudit\Tests\EscapedColumnsEntity',
        'SimpleThings\EntityAudit\Tests\Issue87Project',
        'SimpleThings\EntityAudit\Tests\Issue87ProjectComment',
        'SimpleThings\EntityAudit\Tests\Issue87AbstractProject',
        'SimpleThings\EntityAudit\Tests\Issue87Organization',
        'SimpleThings\EntityAudit\Tests\Issue9Address',
        'SimpleThings\EntityAudit\Tests\Issue9Customer',
        'SimpleThings\EntityAudit\Tests\Issue87Organization',
        'SimpleThings\EntityAudit\Tests\DuplicateRevisionFailureTestPrimaryOwner',
        'SimpleThings\EntityAudit\Tests\DuplicateRevisionFailureTestSecondaryOwner',
        'SimpleThings\EntityAudit\Tests\DuplicateRevisionFailureTestOwnedElement',
        'SimpleThings\EntityAudit\Tests\Issue111Entity',
    );

    protected $auditedEntities = array(
        'SimpleThings\EntityAudit\Tests\EscapedColumnsEntity',
        'SimpleThings\EntityAudit\Tests\Issue87Project',
        'SimpleThings\EntityAudit\Tests\Issue87ProjectComment',
        'SimpleThings\EntityAudit\Tests\Issue87AbstractProject',
        'SimpleThings\EntityAudit\Tests\Issue87Organization',
        'SimpleThings\EntityAudit\Tests\Issue9Address',
        'SimpleThings\EntityAudit\Tests\Issue9Customer',
        'SimpleThings\EntityAudit\Tests\Issue87Organization',
        'SimpleThings\EntityAudit\Tests\DuplicateRevisionFailureTestPrimaryOwner',
        'SimpleThings\EntityAudit\Tests\DuplicateRevisionFailureTestSecondaryOwner',
        'SimpleThings\EntityAudit\Tests\DuplicateRevisionFailureTestOwnedElement',
        'SimpleThings\EntityAudit\Tests\Issue111Entity',
    );

    protected function getGedmoVersion()
    {
        if (class_exists('Gedmo\Version')) {
            return constant('Gedmo\Version::VERSION');
        } elseif (class_exists('Gedmo\DoctrineExtensions')) {
            return constant('Gedmo\DoctrineExtensions::VERSION');
        } else {
            return '0.0.1-DEV';
        }
    }

    public function setUp()
    {
        //softdeleteable is present only in gedmo's 2.3+
        if (version_compare($this->getGedmoVersion(), '2.3') < 0) {
            $this->auditedEntities = array_diff($this->auditedEntities, array('SimpleThings\EntityAudit\Tests\Issue111Entity'));
            $this->schemaEntities = array_diff($this->schemaEntities, array('SimpleThings\EntityAudit\Tests\Issue111Entity'));
        }

        parent::setUp();
    }

    public function testIssue111()
    {
        if (version_compare($this->getGedmoVersion(), '2.3') < 0) {
            $this->markTestSkipped('SoftDeleteable is available only since gedmo 2.3');
        }

        $this->em->getEventManager()->addEventSubscriber(new \Gedmo\SoftDeleteable\SoftDeleteableListener());

{'fraction_non_alphanumeric': 0.09858969289574272, 'fraction_numerical': 0.018584420719652037, 'mean_word_length': 3.8703465982028242, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2007427', 'n_tokens_mistral': 2262, 'n_tokens_neox': 2068, 'n_words': 449}