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 | |||
14 | /** |
||
15 | * Generated by PHPUnit_SkeletonGenerator on 2012-09-04 at 16:54:04. |
||
16 | */ |
||
17 | class AbstractArticlePageTest extends TestCase |
||
0 ignored issues
–
show
|
|||
18 | { |
||
19 | public function testGettersAndSetters() |
||
20 | { |
||
21 | $entity = new ArticlePage(); |
||
22 | $entity->setId(666); |
||
23 | $entity->setDate(new DateTime()); |
||
24 | $entity->setTitle('NASA'); |
||
25 | $entity->setPageTitle('To infinty and beyond'); |
||
26 | $entity->setSummary('blah'); |
||
27 | |||
28 | $this->assertEquals(666, $entity->getId()); |
||
29 | $this->assertEquals('blah', $entity->getSummary()); |
||
30 | $this->assertEquals('To infinty and beyond', $entity->getPageTitle()); |
||
31 | $this->assertEquals('NASA', $entity->getTitle()); |
||
32 | $this->assertInstanceOf(DateTime::class, $entity->getDate()); |
||
33 | $this->assertEquals(AbstractArticlePageAdminType::class, $entity->getAdminType()); |
||
34 | $this->assertTrue(is_array($entity->getPossibleChildTypes())); |
||
35 | $this->assertTrue(is_array($entity->getPagePartAdminConfigurations())); |
||
36 | } |
||
37 | } |
||
38 |
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.