Test Setup Failed
Push — test ( 4e9ef0...2bbcf6 )
by Jonathan
02:51
created

KintTestCase::tearDown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Kint\Test;
4
5
use Kint;
6
use Kint\Object\BlobObject;
7
use PHPUnit_Framework_TestCase;
8
use PHPUnit_Util_InvalidArgumentHelper;
9
10
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...
11
{
12
    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...
13
    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...
14
15
    public function setUp()
16
    {
17
        $this->kint_status = Kint::settings();
18
        $this->char_encodings = BlobObject::$char_encodings;
19
    }
20
21
    public function tearDown()
22
    {
23
        Kint::settings($this->kint_status);
24
        BlobObject::$char_encodings = $this->char_encodings;
25
    }
26
27
    /**
28
     * Asserts that a condition is true.
29
     *
30
     * @param array  $expected
31
     * @param string $actual
32
     * @param string $message
33
     *
34
     * @throws PHPUnit_Framework_Exception
35
     */
36
    public function assertLike(array $expected, $actual, $message = '')
37
    {
38
        if (!is_string($actual)) {
39
            throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'string');
40
        }
41
42
        self::assertThat($actual, new ContainsInOrderConstraint($expected), $message);
43
    }
44
}
45