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

Fixed error Call to undefined method <test class>::getAnnotations() #164

Merged
merged 5 commits into from
Sep 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ We accept contributions via Pull Requests on [Github](https://github.com/10up/wp

## Pull Requests

* New features must be submitted against the the **trunk** branch
* New features must be submitted against the **trunk** branch
* Bug fixes should be submitted against the branch in which the bug exists, which is likely **trunk**.
* If you're not sure whether a feature idea would be something we'd be interested in, please open an issue before you start working on it. We'd be happy to discuss your idea with you.

Expand Down
6 changes: 5 additions & 1 deletion php/WP_Mock/Tools/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use PHPUnit\Framework\TestResult;
use Exception;
use Mockery;
use PHPUnit\Util\Test as TestUtil;
use ReflectionMethod;
use Text_Template;
use WP_Mock;
Expand Down Expand Up @@ -282,7 +283,10 @@ protected function requireFileDependencies() {
protected function setUpContentFiltering() {
$this->__contentFilterCallback = false;

$annotations = $this->getAnnotations();
$annotations = TestUtil::parseTestMethodAnnotations(
static::class,
$this->getName( false )
);
if (
! isset( $annotations['stripTabsAndNewlinesFromOutput'] ) ||
$annotations['stripTabsAndNewlinesFromOutput'][0] !== 'disabled' ||
Expand Down