|
11 | 11 | use PhpMyAdmin\SqlParser\Utils\FormattingOptions; |
12 | 12 | use PHPUnit\Framework\Attributes\DataProvider; |
13 | 13 |
|
14 | | -use function strtoupper; |
15 | | - |
16 | 14 | class FormatterTest extends TestCase |
17 | 15 | { |
18 | 16 | public function testMergeFormats(): void |
19 | 17 | { |
20 | 18 | $object = new FormattingOptions(formats: []); |
21 | | - self::assertEquals($object->formats, FormattingOptions::getDefaultFormats()); |
| 19 | + self::assertSame($object->formats, FormattingOptions::getDefaultFormats()); |
22 | 20 |
|
23 | 21 | $object = new FormattingOptions(formats: [ |
24 | 22 | [ |
25 | 23 | 'type' => TokenType::Keyword, |
26 | 24 | 'flags' => Token::FLAG_KEYWORD_RESERVED, |
27 | 25 | 'html' => 'sql-foo', |
28 | 26 | 'cli' => "\x1b[35m", |
29 | | - 'function' => strtoupper(...), |
| 27 | + 'function' => 'strtoupper', |
30 | 28 | ], |
31 | 29 | [ |
32 | 30 | 'type' => TokenType::Keyword, |
33 | 31 | 'flags' => 0, |
34 | 32 | 'html' => 'sql-bar', |
35 | 33 | 'cli' => "\x1b[95m", |
36 | | - 'function' => strtoupper(...), |
| 34 | + 'function' => 'strtoupper', |
37 | 35 | ], |
38 | 36 | [ |
39 | 37 | 'type' => TokenType::Keyword, |
40 | 38 | 'flags' => Token::FLAG_KEYWORD_COMPOSED, |
41 | 39 | 'html' => 'sql-baz', |
42 | 40 | 'cli' => "\x1b[95m", |
43 | | - 'function' => strtoupper(...), |
| 41 | + 'function' => 'strtoupper', |
44 | 42 | ], |
45 | 43 |
|
46 | 44 | ]); |
47 | 45 |
|
48 | | - self::assertContainsEquals([ |
| 46 | + self::assertContains([ |
49 | 47 | 'type' => TokenType::Keyword, |
50 | 48 | 'flags' => Token::FLAG_KEYWORD_RESERVED, |
51 | 49 | 'html' => 'sql-foo', |
52 | 50 | 'cli' => "\x1b[35m", |
53 | | - 'function' => strtoupper(...), |
| 51 | + 'function' => 'strtoupper', |
54 | 52 | ], $object->formats); |
55 | 53 |
|
56 | | - self::assertContainsEquals([ |
| 54 | + self::assertContains([ |
57 | 55 | 'type' => TokenType::Keyword, |
58 | 56 | 'flags' => 0, |
59 | 57 | 'html' => 'sql-bar', |
60 | 58 | 'cli' => "\x1b[95m", |
61 | | - 'function' => strtoupper(...), |
| 59 | + 'function' => 'strtoupper', |
62 | 60 | ], $object->formats); |
63 | 61 |
|
64 | | - self::assertContainsEquals([ |
| 62 | + self::assertContains([ |
65 | 63 | 'type' => TokenType::Keyword, |
66 | 64 | 'flags' => Token::FLAG_KEYWORD_COMPOSED, |
67 | 65 | 'html' => 'sql-baz', |
68 | 66 | 'cli' => "\x1b[95m", |
69 | | - 'function' => strtoupper(...), |
| 67 | + 'function' => 'strtoupper', |
70 | 68 | ], $object->formats); |
71 | 69 | } |
72 | 70 |
|
|
0 commit comments