<?php

namespace WaddlingCo\StreamPerk\Bundle\ForumBundle\Tests\Entity;

use WaddlingCo\StreamPerk\Bundle\CoreBundle\Tests\Entity\AbstractEntityTest;

class ForumThreadPostTest extends AbstractEntityTest
{
    /**
     * @test
     */
    public function listGroup()
    {
        $this->shouldSerializeCorrectly([self::LIST], [
                'id',
                'thread',
                'creator',
                'content',
                'date_created',
            ]);
    }

    /**
     * @test
     */
    public function detailsGroup()
    {
        $this->shouldSerializeCorrectly([self::DETAILS], [
                'id',
                'thread',
                'creator',
                'content',
                'date_created',
            ]);
    }

    protected function getEntityManager()
    {
        return $this->getContainer()->get('streamperk.forum_thread_post_manager');
    }

    protected function getSampleEntity()
    {
        return $this->getEntityManager()->findOneBy([]);
    }

    protected function getRelatedFixtures()
    {
        $defaultFixtures = parent::getRelatedFixtures();
        $defaultFixtures[] = '@StreamPerkForumBundle/DataFixtures/ORM/Forum.yml';
        $defaultFixtures[] = '@StreamPerkForumBundle/DataFixtures/ORM/ForumThread.yml';
        $defaultFixtures[] = '@StreamPerkForumBundle/DataFixtures/ORM/ForumThreadPost.yml';

        return $defaultFixtures;
    }
}
