Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error occurs with multibyte character test names. #714

Closed
nshiro opened this issue Mar 21, 2023 · 1 comment
Closed

Error occurs with multibyte character test names. #714

nshiro opened this issue Mar 21, 2023 · 1 comment

Comments

@nshiro
Copy link

nshiro commented Mar 21, 2023

Pest 2.0.2

The following error occurs if multibyte characters of the same length are used in the test name.

PHP Fatal error:  Cannot redeclare P\Tests\Feature\BbbTest::__pest_evaluable_______() in /__PATH__/vendor/pestphp/pest/src/Factories/TestCaseFactory.php(196) : eval()'d code on line 37

   ERROR  Fatal error: Cannot redeclare P\Tests\Feature\BbbTest::__pest_evaluable_______() in /__PATH__/vendor/pestphp/pest/src/Factories/TestCaseFactory.php(196) : eval()'d code on line 37.

Sample Code

<?php

test('ほげ', function () {
    $this->assertTrue(true);
});

test('ふが', function () {
    $this->assertTrue(true);
});

I'm not sure if this is a bug or intentional, but at least it didn't happen in version 1.
Pest\Support::evaluable seems to be the problem area.

As you know, multibyte characters can be used in normal PHP function names.
So it is kind of normal for us Japanese to use multibyte characters in test names.

Thank you for your hard work!

@fabio-ivona
Copy link
Collaborator

fixed in #715

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants