KintTestCase::assertLike()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 3
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
abstract class KintTestCase extends PHPUnit_Framework_TestCase
0 ignored issues
show
Coding Style introduced by
KintTestCase does not seem to conform to the naming convention (^Abstract|Factory$).

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...
Coding Style introduced by
The property $kint_status is not named in camelCase.

This check marks property names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
Coding Style introduced by
The property $char_encodings is not named in camelCase.

This check marks property names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
4
{
5
    protected $kint_status;
0 ignored issues
show
Coding Style introduced by
$kint_status 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...
6
    protected $char_encodings;
0 ignored issues
show
Coding Style introduced by
$char_encodings 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...
7
8
    public function setUp()
9
    {
10
        $this->kint_status = Kint::settings();
11
        $this->char_encodings = Kint_Object_Blob::$char_encodings;
12
    }
13
14
    public function tearDown()
15
    {
16
        Kint::settings($this->kint_status);
17
        Kint_Object_Blob::$char_encodings = $this->char_encodings;
18
    }
19
20
    /**
21
     * Asserts that a condition is true.
22
     *
23
     * @param array  $expected
24
     * @param string $actual
25
     * @param string $message
26
     *
27
     * @throws PHPUnit_Framework_AssertionFailedError
28
     */
29
    public static function assertLike(array $expected, $actual, $message = '')
30
    {
31
        if (!is_string($actual)) {
32
            throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string');
33
        }
34
35
        self::assertThat($actual, new ContainsInOrder($expected), $message);
36
    }
37
}
38