NameWorksTraitTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 11
c 0
b 0
f 0
dl 0
loc 24
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetClassName() 0 7 1
A testGetNamespaceParentFolder() 0 6 1
A testIsNamespaced() 0 3 1
1
<?php
2
3
namespace Nip\Utility\Tests\Traits;
4
5
use Nip\Utility\Traits\NameWorksTrait;
6
7
/**
8
 * Class NameWorksTraitTest
9
 * @package Nip\Utility\Tests\Traits
10
 */
11
class NameWorksTraitTest extends \Nip\Utility\Tests\AbstractTest
12
{
13
    use NameWorksTrait;
14
15
    public function testGetClassName()
16
    {
17
        self::assertSame('Nip\Utility\Tests\Traits\NameWorksTraitTest', $this->getClassName());
18
19
        $name = 'Userrs';
20
        $this->setClassName($name);
0 ignored issues
show
Bug introduced by
$name of type string is incompatible with the type boolean|null expected by parameter $className of Nip\Utility\Tests\Traits...aitTest::setClassName(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

20
        $this->setClassName(/** @scrutinizer ignore-type */ $name);
Loading history...
21
        self::assertSame($name, $this->getClassName());
22
    }
23
24
    public function testIsNamespaced()
25
    {
26
        self::assertTrue($this->isNamespaced());
27
    }
28
29
    public function testGetNamespaceParentFolder()
30
    {
31
        self::assertSame('Traits', $this->getNamespaceParentFolder());
32
        self::assertSame(
33
            ['Nip', 'Utility', 'Tests', 'Traits', 'NameWorksTraitTest'],
34
            $this->getClassNameParts()
35
        );
36
    }
37
}
38