| Total Complexity | 3 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class UtilsTest extends TestCase |
||
| 14 | { |
||
| 15 | public function testAssignThrowsExceptionOnMissingRequiredKey() : void |
||
| 16 | { |
||
| 17 | $object = new stdClass(); |
||
| 18 | $object->requiredKey = 'value'; |
||
| 19 | |||
| 20 | $this->expectException(InvalidArgumentException::class); |
||
| 21 | $this->expectExceptionMessage('Key requiredKey is expected to be set and not to be null'); |
||
| 22 | Utils::assign($object, [], ['requiredKey']); |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param int $input |
||
| 27 | * @param string $expected |
||
| 28 | * |
||
| 29 | * @dataProvider chrUtf8DataProvider |
||
| 30 | */ |
||
| 31 | public function testChrUtf8Generation($input, $expected) : void |
||
| 32 | { |
||
| 33 | $result = Utils::chr($input); |
||
| 34 | self::assertTrue(mb_check_encoding($result, 'UTF-8')); |
||
| 35 | self::assertEquals($expected, $result); |
||
| 36 | } |
||
| 37 | |||
| 38 | public function chrUtf8DataProvider() |
||
| 56 | ], |
||
| 57 | ]; |
||
| 58 | } |
||
| 60 |