Kint_Object_RepresentationTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testConstruct() 0 14 1
A testGetLabel() 0 10 1
A testLabelIsImplicit() 0 7 1
1
<?php
2
3
class Kint_Object_RepresentationTest extends KintTestCase
0 ignored issues
show
Coding Style introduced by
Kint_Object_RepresentationTest does not seem to conform to the naming convention (^[A-Z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
4
{
5
    public function testConstruct()
6
    {
7
        $r = new Kint_Object_Representation('This is a label');
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $r. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
8
        $this->assertEquals('This is a label', $r->label);
9
        $this->assertEquals('this_is_a_label', $r->name);
10
11
        $r = new Kint_Object_Representation('This is a label', 'this_is_a_name');
12
        $this->assertEquals('This is a label', $r->label);
13
        $this->assertEquals('this_is_a_name', $r->name);
14
15
        $r = new Kint_Object_Representation('Test # 3');
16
        $this->assertEquals('Test # 3', $r->label);
17
        $this->assertEquals('test_3', $r->name);
18
    }
19
20
    public function testGetLabel()
21
    {
22
        $r = new Kint_Object_Representation('This is a label');
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $r. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
23
        $this->assertEquals('This is a label', $r->getLabel());
24
        $r->contents = array(1);
25
        $this->assertEquals('This is a label', $r->getLabel());
26
        $r->contents[] = 2;
27
        $r->contents[] = 3;
28
        $this->assertEquals('This is a label (3)', $r->getLabel());
29
    }
30
31
    public function testLabelIsImplicit()
32
    {
33
        $r = new Kint_Object_Representation('This is a label');
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $r. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
34
        $this->assertEquals(false, $r->labelIsImplicit());
35
        $r->implicit_label = true;
36
        $this->assertEquals(true, $r->labelIsImplicit());
37
    }
38
}
39