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

Functions::deleteFunction() doesn't check Runkit::isAvailable() #24

Closed
stevegrunwell opened this issue Jan 18, 2021 · 0 comments · Fixed by #25
Closed

Functions::deleteFunction() doesn't check Runkit::isAvailable() #24

stevegrunwell opened this issue Jan 18, 2021 · 0 comments · Fixed by #25
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@stevegrunwell
Copy link
Member

Before attempting to call runkit functions, we first need to make sure that runkit/runkit7 are installed and active; if not, we mark the current test as skipped:

use AssertWell\PHPUnitGlobalState\Support\Runkit;

if (! Runkit::isAvailable()) {
  $this->markTestSkipped('someMethod() requires Runkit be available, skipping.');
}

This check isn't happening in AssertWell\PHPUnitGlobalState\Functions::deleteFunction(), which can cause tests to error inappropriately if runkit isn't available.

@stevegrunwell stevegrunwell added bug Something isn't working good first issue Good for newcomers labels Jan 18, 2021
@stevegrunwell stevegrunwell added this to the Version 0.3.0 milestone Jan 18, 2021
stevegrunwell added a commit that referenced this issue Apr 15, 2021
…f Runkit is unavailable

Similar checks are used elsewhere for Runkit-dependent methods, as this prevents tests from erroring due to Runkit not being present.

Fixes #24.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
1 participant