Skip to content

Commit 2086023

Browse files
committed
Fix tests
1 parent bf52454 commit 2086023

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

HtmlExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ public static function htmlClasses(...$args): string
9797
} elseif (\is_array($arg)) {
9898
foreach ($arg as $class => $condition) {
9999
if (!\is_string($class)) {
100-
throw new RuntimeError(\sprintf('The html_classes function argument %d (key %d) should be a string, got "%s".', $i, $class, get_debug_type($class)));
100+
throw new RuntimeError(\sprintf('The "html_classes" function argument %d (key %d) should be a string, got "%s".', $i, $class, get_debug_type($class)));
101101
}
102102
if (!$condition) {
103103
continue;
104104
}
105105
$classes[] = $class;
106106
}
107107
} else {
108-
throw new RuntimeError(\sprintf('The html_classes function argument %d should be either a string or an array, got "%s".', $i, get_debug_type($arg)));
108+
throw new RuntimeError(\sprintf('The "html_classes" function argument %d should be either a string or an array, got "%s".', $i, get_debug_type($arg)));
109109
}
110110
}
111111

Tests/Fixtures/html_classes_with_unsupported_arg.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
--DATA--
66
return []
77
--EXCEPTION--
8-
Twig\Error\RuntimeError: The html_classes function argument 0 should be either a string or an array, got "boolean" in "index.twig" at line 2.
8+
Twig\Error\RuntimeError: The "html_classes" function argument 0 should be either a string or an array, got "bool" in "index.twig" at line 2.

Tests/Fixtures/html_classes_with_unsupported_key.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
--DATA--
66
return []
77
--EXCEPTION--
8-
Twig\Error\RuntimeError: The html_classes function argument 0 (key 0) should be a string, got "integer" in "index.twig" at line 2.
8+
Twig\Error\RuntimeError: The "html_classes" function argument 0 (key 0) should be a string, got "int" in "index.twig" at line 2.

0 commit comments

Comments
 (0)