Kint_Object_RepresentationTest::testGetLabel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
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