| 1 | <?php  | 
            ||
| 10 | abstract class KintTestCase extends PHPUnit_Framework_TestCase  | 
            ||
| 11 | { | 
            ||
| 12 | protected $kint_status;  | 
            ||
| 13 | protected $char_encodings;  | 
            ||
| 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 |