Skip to content

Commit

Permalink
Tests: fix two tests for PHP 8 identifier names
Browse files Browse the repository at this point in the history
* One test didn't yet take PHP 8 identifier names into account.
* The other did, but contained a typo/count error.
  • Loading branch information
jrfnl committed Dec 22, 2020
1 parent 4837a10 commit 5c69cbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Tests/BackCompat/BCFile/GetMethodPropertiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,14 @@ public function testReturnNamespace()
*/
public function testReturnMultilineNamespace()
{
$php8Names = parent::usesPhp8NameTokens();

$expected = [
'scope' => 'public',
'scope_specified' => false,
'return_type' => '\MyNamespace\MyClass\Foo',
'return_type_token' => 7, // Offset from the T_FUNCTION token.
'return_type_end_token' => 23, // Offset from the T_FUNCTION token.
'return_type_end_token' => ($php8Names === true) ? 20 : 23, // Offset from the T_FUNCTION token.
'nullable_return_type' => false,
'is_abstract' => false,
'is_final' => false,
Expand Down
2 changes: 1 addition & 1 deletion Tests/Utils/PassedParameters/GetParametersNamedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function dataGetParameters()
],
3 => [
'start' => ($php8Names === true) ? 7 : 8,
'end' => ($php8Names === true) ? 7 : 11,
'end' => ($php8Names === true) ? 8 : 11,
'raw' => 'MyNS\VALUE',
],
],
Expand Down

0 comments on commit 5c69cbb

Please sign in to comment.