GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — master (#63)
by joseph
03:18
created

MappingHelperTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 32
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetTableNameForEntityFqn() 0 6 1
A testGetColumnName() 0 9 2
A itCanHandleTheWordStaffForPluralAndSingular() 0 6 1
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta;
4
5
use PHPUnit\Framework\TestCase;
6
7
/**
8
 * @SuppressWarnings(PHPMD.StaticAccess)
9
 */
10
class MappingHelperTest extends TestCase
11
{
12
    public function testGetTableNameForEntityFqn()
13
    {
14
        $expected  = '`bar_baz`';
15
        $entityFqn = '\\DSM\\Test\\Project\\Entities\\Bar\\Baz';
16
        $actual    = MappingHelper::getTableNameForEntityFqn($entityFqn);
17
        $this->assertSame($expected, $actual);
18
    }
19
20
    public function testGetColumnName()
21
    {
22
        $fieldNamesToExpectedColumnNames = [
23
            'test'                   => '`test`',
24
            'longThingWithCamelCase' => '`long_thing_with_camel_case`',
25
        ];
26
        foreach ($fieldNamesToExpectedColumnNames as $field => $expected) {
27
            $actual = MappingHelper::getColumnNameForField($field);
28
            $this->assertSame($expected, $actual);
29
        }
30
    }
31
32
    /**
33
     * @test
34
     * @small
35
     */
36
    public function itCanHandleTheWordStaffForPluralAndSingular()
37
    {
38
        $entityFqn = '\\Test\\Project\\Entity\\Staff';
39
        $plural    = MappingHelper::getPluralForFqn($entityFqn);
40
        $singular  = MappingHelper::getSingularForFqn($entityFqn);
41
        $this->assertNotSame($plural, $singular);
42
    }
43
}
44