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

[2.x] Fixing Backtrace not found error if project dirname endswith pest #972

Merged

Conversation

Carnicero90
Copy link
Contributor

What:

  • Bug Fix
  • New Feature

Description:

Currently, \Pest\Support\Backtrace::backtrace() is skipping every file which str_contains($trace['file'], 'pest'.DIRECTORY_SEPARATOR.'src', so that for whatever reason the base folder of the project's name ends with pest (i.e.: testpest, which was actually my folder name), it fall back to throw ShouldNotHappen::fromMessage('Backtrace not found.');. I guess DIRECTORY_SEPARATOR.'pestphp'.DIRECTORY_SEPARATOR.'pest'.DIRECTORY_SEPARATOR.'src' should be safe enough to avoid that issue.

@devajmeireles devajmeireles changed the title Fixing Backtrace not found error if project dirname endswith pest [2.x] Fixing Backtrace not found error if project dirname endswith pest Oct 6, 2023
@devajmeireles
Copy link
Member

Hey, @Carnicero90 ! Thanks for your PR.

Could you fix the errors here, please? Thank you.

@Carnicero90
Copy link
Contributor Author

Yeah I'll look into that, but I'm not sure it is related with my commit, since I get the very same error even if I run make test or composer test:unit in a fresh clone of the original repo (on branch 2.x)

@Carnicero90
Copy link
Contributor Author

@devajmeireles are you positive that those issue are caused by something in my PR? Cos I am getting the very same error (a DatasetMissing exception whenever you are trying to set the value for the test in a describe context via beforeEach()->with(values);) even without any change at all in the source code. Still, I could try to fix that, but it looks like a completely different issue, which deserves a dedicated issue/pr. Dunno if I am missing something trivial, my apologies if that's the case.

@nunomaduro nunomaduro merged commit 79da02c into pestphp:2.x Jan 25, 2024
2 of 20 checks passed
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

Successfully merging this pull request may close these issues.

3 participants