Completed
Pull Request — master (#2101)
by Kevin
18:19
created

Tests/Entity/AbstractArticlePageTest.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Kunstmaan\ArticleBundle\Tests\Entity;
4
5
use DateTime;
6
use Kunstmaan\ArticleBundle\Entity\AbstractArticlePage;
7
use Kunstmaan\ArticleBundle\Form\AbstractArticlePageAdminType;
8
use PHPUnit_Framework_TestCase;
9
10
class ArticlePage extends AbstractArticlePage{}
11
12
/**
13
 * Generated by PHPUnit_SkeletonGenerator on 2012-09-04 at 16:54:04.
14
 */
15
class AbstractArticlePageTest extends PHPUnit_Framework_TestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
16
{
17
    public function testGettersAndSetters()
18
    {
19
        $entity = new ArticlePage();
20
        $entity->setId(666);
21
        $entity->setDate(new DateTime());
22
        $entity->setTitle('NASA');
23
        $entity->setPageTitle('To infinty and beyond');
24
        $entity->setSummary('blah');
25
26
        $this->assertEquals(666, $entity->getId());
27
        $this->assertEquals('blah', $entity->getSummary());
28
        $this->assertEquals('To infinty and beyond', $entity->getPageTitle());
29
        $this->assertEquals('NASA', $entity->getTitle());
30
        $this->assertInstanceOf(DateTime::class, $entity->getDate());
31
        $this->assertEquals(AbstractArticlePageAdminType::class, $entity->getAdminType());
32
        $this->assertTrue(is_array($entity->getPossibleChildTypes()));
33
        $this->assertTrue(is_array($entity->getPagePartAdminConfigurations()));
34
    }
35
}
36