Skip to content

Commit

Permalink
Create test for count_chars
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-tekiela committed Dec 7, 2021
1 parent 88ce10b commit d274550
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/FunctionCallTest.php
Expand Up @@ -1747,6 +1747,24 @@ function sayHello(string $needle): void {
[],
'8.1',
],
'count_charsProducesArrayOrString' => [
'<?php
$a = count_chars("foo");
$b = count_chars("foo", 1);
$c = count_chars("foo", 2);
$d = count_chars("foo", 3);
$e = count_chars("foo", 4);
',
'assertions' => [
'$a===' => 'array<int, int>',
'$b===' => 'array<int, int>',
'$c===' => 'array<int, int>',
'$d===' => 'string',
'$e===' => 'string',
],
[],
'8.1',
],
];
}

Expand Down Expand Up @@ -2284,6 +2302,11 @@ function takesAString(string $s): void{
echo get_class();',
'error_message' => 'TooFewArguments',
],
'count_charsWithInvalidMode' => [
'<?php
count_chars("foo", 5);',
'error_message' => 'InvalidArgument',
],
];
}

Expand Down

0 comments on commit d274550

Please sign in to comment.