<commit_before><?php

namespace OpenCFP\Test\Domain\Entity\Mapper;

use OpenCFP\Application;
use OpenCFP\Environment;

/**
 * @group db
 */
class TalkMapperTest extends \PHPUnit_Framework_TestCase
{
    private $app;
    private $mapper;
    private $entities = ['Talk', 'TalkMeta', 'User', 'Favorite'];

    protected function setUp()
    {
        $this->app = new Application(BASE_PATH, Environment::testing());
        $cfg = new \Spot\Config;
        $cfg->addConnection('sqlite', [
            'dbname' => 'sqlite::memory',
            'driver' => 'pdo_sqlite',
        ]);
        $this->app['spot'] = new \Spot\Locator($cfg);
        $this->mapper = $this->app['spot']->mapper(\OpenCFP\Domain\Entity\Talk::class);

        foreach ($this->entities as $entity) {
            $this->app['spot']->mapper('OpenCFP\Domain\Entity\\' . $entity)->migrate();
        }
    }

    /**
     * @test
     */
    public function getAdminFavoritesReturnsCorrectList()
    {
        // Create a test talk
        $admin_user_id = 1;
        $admin_majority = 3;<commit_msg>Fix Talk mapper testcase class name<commit_after><?php

namespace OpenCFP\Test\Domain\Entity\Mapper;

use OpenCFP\Application;
use OpenCFP\Environment;

/**
 * @group db
 */
class TalkTest extends \PHPUnit_Framework_TestCase
{
    private $app;
    private $mapper;
    private $entities = ['Talk', 'TalkMeta', 'User', 'Favorite'];

    protected function setUp()
    {
        $this->app = new Application(BASE_PATH, Environment::testing());
        $cfg = new \Spot\Config;
        $cfg->addConnection('sqlite', [
            'dbname' => 'sqlite::memory',
            'driver' => 'pdo_sqlite',
        ]);
        $this->app['spot'] = new \Spot\Locator($cfg);
        $this->mapper = $this->app['spot']->mapper(\OpenCFP\Domain\Entity\Talk::class);

        foreach ($this->entities as $entity) {
            $this->app['spot']->mapper('OpenCFP\Domain\Entity\\' . $entity)->migrate();
        }
    }

    /**
     * @test
     */
    public function getAdminFavoritesReturnsCorrectList()
    {
        // Create a test talk
        $admin_user_id = 1;
        $admin_majority = 3;
{'fraction_non_alphanumeric': 0.164804469273743, 'fraction_numerical': 0.00186219739292365, 'mean_word_length': 2.55794701986755, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '6073687', 'n_tokens_mistral': 691, 'n_tokens_neox': 675, 'n_words': 126}