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\ConfigBundle\Tests\Entity; |
||
4 | |||
5 | use Kunstmaan\ConfigBundle\Entity\AbstractConfig; |
||
6 | use PHPUnit\Framework\TestCase; |
||
7 | |||
8 | class Config extends AbstractConfig |
||
9 | { |
||
10 | public function getDefaultAdminType() |
||
11 | { |
||
12 | return null; |
||
13 | } |
||
14 | |||
15 | public function getInternalName() |
||
16 | { |
||
17 | return null; |
||
18 | } |
||
19 | |||
20 | public function getLabel() |
||
21 | { |
||
22 | return null; |
||
23 | } |
||
24 | } |
||
25 | |||
26 | class AbstractConfigTest extends TestCase |
||
0 ignored issues
–
show
|
|||
27 | { |
||
28 | public function testGettersAndSetters() |
||
29 | { |
||
30 | $entity = new Config(); |
||
31 | |||
32 | $this->assertTrue(is_array($entity->getRoles())); |
||
33 | $this->assertEquals('ROLE_SUPER_ADMIN', $entity->getRoles()[0]); |
||
34 | } |
||
35 | } |
||
36 |
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.