<commit_before><?php

namespace Joindin\Api\Test\Controller;

use Joindin\Api\Model\EventMapper;
use Joindin\Api\Model\OAuthModel;
use Joindin\Api\Model\TalkCommentMapper;
use Joindin\Api\Model\TalkMapper;
use Joindin\Api\Model\TalkModel;
use Joindin\Api\Model\UserMapper;
use Joindin\Api\Request;
use JoindinTest\Inc\mockPDO;
use PHPUnit\Framework\TestCase;

class TalkBase extends TestCase
{
    protected $talk_mapper;

    protected function setUp(): void
    {
        $this->talk_mapper = $this
            ->getMockBuilder(TalkMapper::class)
            ->disableOriginalConstructor()
            ->getMock();

        parent::setUp();
    }

    protected function createTalkMapper(mockPDO $db, Request $request, $expectedCalls = 1)
    {
        $talk_mapper = $this->getMockBuilder(TalkMapper::class)
            ->setConstructorArgs([$db,$request])
            ->getMock();

        $talk_mapper
            ->expects($this->exactly($expectedCalls))
            ->method('getTalkById')
            ->willReturn(
                new TalkModel([
                    'talk_title' => 'talk_title',
                    'url_friendly_talk_title' => 'url_friendly_talk_title',
                    'talk_description' => 'talk_desc',
                    'type' => 'talk_type',
                    'start_date' => 'date_given',
                    'duration' => 'duration',
                    'stub' => 'stub',<commit_msg>Fix: Mark class as abstract<commit_after><?php

namespace Joindin\Api\Test\Controller;

use Joindin\Api\Model\EventMapper;
use Joindin\Api\Model\OAuthModel;
use Joindin\Api\Model\TalkCommentMapper;
use Joindin\Api\Model\TalkMapper;
use Joindin\Api\Model\TalkModel;
use Joindin\Api\Model\UserMapper;
use Joindin\Api\Request;
use JoindinTest\Inc\mockPDO;
use PHPUnit\Framework\TestCase;

abstract class TalkBase extends TestCase
{
    protected $talk_mapper;

    protected function setUp(): void
    {
        $this->talk_mapper = $this
            ->getMockBuilder(TalkMapper::class)
            ->disableOriginalConstructor()
            ->getMock();

        parent::setUp();
    }

    protected function createTalkMapper(mockPDO $db, Request $request, $expectedCalls = 1)
    {
        $talk_mapper = $this->getMockBuilder(TalkMapper::class)
            ->setConstructorArgs([$db,$request])
            ->getMock();

        $talk_mapper
            ->expects($this->exactly($expectedCalls))
            ->method('getTalkById')
            ->willReturn(
                new TalkModel([
                    'talk_title' => 'talk_title',
                    'url_friendly_talk_title' => 'url_friendly_talk_title',
                    'talk_description' => 'talk_desc',
                    'type' => 'talk_type',
                    'start_date' => 'date_given',
                    'duration' => 'duration',
                    'stub' => 'stub',
{'fraction_non_alphanumeric': 0.12434691745036573, 'fraction_numerical': 0.0006966213862765587, 'mean_word_length': 2.278538812785388, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, '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': '7532148', 'n_tokens_mistral': 871, 'n_tokens_neox': 832, 'n_words': 142}