<commit_before><?php

/*
 * This file is part of the Integrated package.
 *
 * (c) e-Active B.V. <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Integrated\Bundle\ContentBundle\Tests\Document\Content;

use Integrated\Bundle\ContentBundle\Document\Content\Article;

/**
 * @author <NAME> <<EMAIL>>
 */
class ArticleTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var Article
     */
    private $article;

    /**
     * Setup the test
     */
    protected function setUp()
    {
        $this->article = new Article();
    }

    /**
     * Article should implement ContentInterface
     */
    public function testContentInterface()
    {
        $this->assertInstanceOf('Integrated\Common\Content\ContentInterface', $this->article);
    }

    /**
     * Article should extend Content
     */
    public function testAbstractContent()
    {
        $this->assertInstanceOf('Integrated\Bundle\ContentBundle\Document\Content\AbstractContent', $this->article);
    }

    /**
     * Test get- and setId function
     */
    public function testGetAndSetIdFunction()
    {
        $id = 'abc123';
        $this->assertEquals($id, $this->article->setId($id)->getId());
    }

    /**
     * Test get- and setType function
     */
    public function testGetAndSetTypeFunction()
    {
        $type = 'type';
        $this->assertEquals($type, $this->article->setType($type)->getType());
    }

    /**
     * Test get- and setReferences function
     */
    public function testGetAndSetReferencesFunction()
    {
        /* @var $references \Doctrine\Common\Collections\ArrayCollection | \PHPUnit_Framework_MockObject_MockObject */
        $references = $this->getMock('Doctrine\Common\Collections\ArrayCollection');
        $this->assertSame($references, $this->article->setReferences($references)->getReferences());
    }

    /**
     * Test get- and setCreatedAt function
     */
    public function testGetAndSetCreatedAtFunction()
    {
        $createdAt = new \DateTime();
        $this->assertSame($createdAt, $this->article->setCreatedAt($createdAt)->getCreatedAt());
    }

    /**
     * Test get- and setUpdated function
     */
    public function testGetAndSetUpdatedAtFunction()
    {
        $updatedAt = new \DateTime();
        $this->assertSame($updatedAt, $this->article->setUpdatedAt($updatedAt)->getUpdatedAt());
    }

    /**
     * Test get- and setPublishedAt function
     */
    public function testGetAndSetPublishedAtFunction()
    {
        $publishedAt = new \DateTime();
        $this->assertSame($publishedAt, $this->article->setPublishedAt($publishedAt)->getPublishedAt());
    }

    /**
     * Test get- and setDisabled function
     */
    public function testGetAndSetDisabledFunction()
    {
        $this->assertTrue($this->article->setDisabled(true)->getDisabled());
        $this->assertFalse($this->article->setDisabled(false)->getDisabled());
    }

    /**
     * Test get- and setMetadata function
     */
    public function testGetAndSetMetadataFunction()
    {
        $metadata = array('key' => 'value');
        $this->assertSame($metadata, $this->article->setMetadata($metadata)->getMetadata());
    }

    /**
     * Test get- and setTitle function
     */
    public function testGetAndSetTitleFunction()
    {
        $title = array('nl' => 'Titel', 'en' => 'Title');
        $this->assertSame($title, $this->article->setTitle($title)->getTitle());
    }

    /**
     * Test get- and setSubtitle function
     */
    public function testGetAndSetSubtitleFunction()
    {
        $subtitle = array('nl' => 'Onderkop', 'en' => 'Subtitle');
        $this->assertEquals($subtitle, $this->article->setSubtitle($subtitle)->getSubtitle());
    }

    /**
     * Test get- and setAuthors function
     */
    public function testGetAndSetAuthorsFunction()
    {
        $authors = array('key' => 'value');
        $this->assertSame($authors, $this->article->setAuthors($authors)->getAuthors());
    }

    /**
     * Test get- and setSource function
     */
    public function testGetAndSetSourceFunction()
    {
        $source = 'source';
        $this->assertEquals($source, $this->article->setSource($source)->getSource());
    }

    /**
     * Test get- and setLocale function
     */
    public function testGetAndSetLocaleFunction()
    {
        $locale = 'locale';
        $this->assertEquals($locale, $this->article->setLocale($locale)->getLocale());
    }

    /**
     * Test get- and setPublishedUntil function
     */
    public function testGetAndSetPublishedUntilFunction()
    {
        $publishedUntil = new \DateTime();
        $this->assertSame($publishedUntil, $this->article->setPublishedUntil($publishedUntil)->getPublishedUntil());
    }

    /**
     * Test get- and setIntro function
     */
    public function testGetAndSetIntroFunction()
    {
        $intro = array('nl' => 'Inleiding', 'en' => 'Introduction');
        $this->assertEquals($intro, $this->article->setIntro($intro)->getIntro());
    }

    /**
     * Test get- and setContent function
     */
    public function testGetAndSetContentFunction()
    {
        $content = array('nl' => 'Bericht', 'en' => 'Message');
        $this->assertEquals($content, $this->article->setContent($content)->getContent());
    }

    /**
     * Test get- and setLocation function
     */
    public function testGetAndSetLocationFunction()
    {
        /* @var $location \Integrated\Bundle\ContentBundle\Document\Content\Embedded\Location | \PHPUnit_Framework_MockObject_MockObject */
        $location = $this->getMock('Integrated\Bundle\ContentBundle\Document\Content\Embedded\Location');
        $this->assertSame($location, $this->article->setLocation($location)->getLocation());
    }
}<commit_msg>Updated Article test with instance of Content instead of AbstractContent<commit_after><?php

/*
 * This file is part of the Integrated package.
 *
 * (c) e-Active B.V. <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Integrated\Bundle\ContentBundle\Tests\Document\Content;

use Integrated\Bundle\ContentBundle\Document\Content\Article;

/**
 * @author <NAME> <<EMAIL>>
 */
class ArticleTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var Article
     */
    private $article;

    /**
     * Setup the test
     */
    protected function setUp()
    {
        $this->article = new Article();
    }

    /**
     * Article should implement ContentInterface
     */
    public function testInstanceOfContentInterface()
    {
        $this->assertInstanceOf('Integrated\Common\Content\ContentInterface', $this->article);
    }

    /**
     * Article should extend Content
     */
    public function testInstanceOfContent()
    {
        $this->assertInstanceOf('Integrated\Bundle\ContentBundle\Document\Content\Content', $this->article);
    }

    /**
     * Test get- and setId function
     */
    public function testGetAndSetIdFunction()
    {
        $id = 'abc123';
        $this->assertEquals($id, $this->article->setId($id)->getId());
    }

    /**
     * Test get- and setType function
     */
    public function testGetAndSetTypeFunction()
    {
        $type = 'type';
        $this->assertEquals($type, $this->article->setType($type)->getType());
    }

    /**
     * Test get- and setReferences function
     */
    public function testGetAndSetReferencesFunction()
    {
        /* @var $references \Doctrine\Common\Collections\ArrayCollection | \PHPUnit_Framework_MockObject_MockObject */
        $references = $this->getMock('Doctrine\Common\Collections\ArrayCollection');
        $this->assertSame($references, $this->article->setReferences($references)->getReferences());
    }

    /**
     * Test get- and setCreatedAt function
     */
    public function testGetAndSetCreatedAtFunction()
    {
        $createdAt = new \DateTime();
        $this->assertSame($createdAt, $this->article->setCreatedAt($createdAt)->getCreatedAt());
    }

    /**
     * Test get- and setUpdated function
     */
    public function testGetAndSetUpdatedAtFunction()
    {
        $updatedAt = new \DateTime();
        $this->assertSame($updatedAt, $this->article->setUpdatedAt($updatedAt)->getUpdatedAt());
    }

    /**
     * Test get- and setPublishedAt function
     */
    public function testGetAndSetPublishedAtFunction()
    {
        $publishedAt = new \DateTime();
        $this->assertSame($publishedAt, $this->article->setPublishedAt($publishedAt)->getPublishedAt());
    }

    /**
     * Test get- and setDisabled function
     */
    public function testGetAndSetDisabledFunction()
    {
        $this->assertTrue($this->article->setDisabled(true)->getDisabled());
        $this->assertFalse($this->article->setDisabled(false)->getDisabled());
    }

    /**
     * Test get- and setMetadata function
     */
    public function testGetAndSetMetadataFunction()
    {
        $metadata = array('key' => 'value');
        $this->assertSame($metadata, $this->article->setMetadata($metadata)->getMetadata());
    }

    /**
     * Test get- and setTitle function
     */
    public function testGetAndSetTitleFunction()
    {
        $title = array('nl' => 'Titel', 'en' => 'Title');
        $this->assertSame($title, $this->article->setTitle($title)->getTitle());
    }

    /**
     * Test get- and setSubtitle function
     */
    public function testGetAndSetSubtitleFunction()
    {
        $subtitle = array('nl' => 'Onderkop', 'en' => 'Subtitle');
        $this->assertEquals($subtitle, $this->article->setSubtitle($subtitle)->getSubtitle());
    }

    /**
     * Test get- and setAuthors function
     */
    public function testGetAndSetAuthorsFunction()
    {
        $authors = array('key' => 'value');
        $this->assertSame($authors, $this->article->setAuthors($authors)->getAuthors());
    }

    /**
     * Test get- and setSource function
     */
    public function testGetAndSetSourceFunction()
    {
        $source = 'source';
        $this->assertEquals($source, $this->article->setSource($source)->getSource());
    }

    /**
     * Test get- and setLocale function
     */
    public function testGetAndSetLocaleFunction()
    {
        $locale = 'locale';
        $this->assertEquals($locale, $this->article->setLocale($locale)->getLocale());
    }

    /**
     * Test get- and setPublishedUntil function
     */
    public function testGetAndSetPublishedUntilFunction()
    {
        $publishedUntil = new \DateTime();
        $this->assertSame($publishedUntil, $this->article->setPublishedUntil($publishedUntil)->getPublishedUntil());
    }

    /**
     * Test get- and setIntro function
     */
    public function testGetAndSetIntroFunction()
    {
        $intro = array('nl' => 'Inleiding', 'en' => 'Introduction');
        $this->assertEquals($intro, $this->article->setIntro($intro)->getIntro());
    }

    /**
     * Test get- and setContent function
     */
    public function testGetAndSetContentFunction()
    {
        $content = array('nl' => 'Bericht', 'en' => 'Message');
        $this->assertEquals($content, $this->article->setContent($content)->getContent());
    }

    /**
     * Test get- and setLocation function
     */
    public function testGetAndSetLocationFunction()
    {
        /* @var $location \Integrated\Bundle\ContentBundle\Document\Content\Embedded\Location | \PHPUnit_Framework_MockObject_MockObject */
        $location = $this->getMock('Integrated\Bundle\ContentBundle\Document\Content\Embedded\Location');
        $this->assertSame($location, $this->article->setLocation($location)->getLocation());
    }
}
{'fraction_non_alphanumeric': 0.1475563110922227, 'fraction_numerical': 0.000509987250318742, 'mean_word_length': 2.835071707953064, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 191, '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': '3208849', 'n_tokens_mistral': 3301, 'n_tokens_neox': 3211, 'n_words': 613}