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

Run PHPUnit jobs across multiple PHP versions #46510

Merged
merged 79 commits into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
b555d9d
Add a small change to create a PR.
anton-vlasenko Dec 13, 2022
6547f78
Add multiple php versions.
anton-vlasenko Dec 13, 2022
4bf84bb
Add multiple php versions.
anton-vlasenko Dec 13, 2022
1285d42
Define phpVersion as environment variable.
anton-vlasenko Dec 13, 2022
cd74382
Add phpunit tags for PHP 8.1 and 8.2.
anton-vlasenko Dec 13, 2022
20e6d53
Remove hyphen.
anton-vlasenko Dec 13, 2022
f192e2e
Nove PHPUnit tests to a separate file.
anton-vlasenko Dec 13, 2022
0da70ae
Disable `fail-fast`.
anton-vlasenko Dec 13, 2022
c3bbb6a
Update matrix.os.
anton-vlasenko Dec 13, 2022
9b6cd40
Install composer dependencies.
anton-vlasenko Dec 13, 2022
53180a4
Revert "Install composer dependencies."
anton-vlasenko Dec 13, 2022
b60db3d
Revert "Revert "Install composer dependencies.""
anton-vlasenko Dec 13, 2022
2a687ae
Fixing "no phpunit found" error.
aaroncampbell Dec 13, 2022
c161a74
Revert "Fixing "no phpunit found" error."
anton-vlasenko Dec 13, 2022
4381998
Add phpunit tags for PHP 8.1 and 8.2.
anton-vlasenko Dec 13, 2022
f340a41
Debug the phpunitImage.
anton-vlasenko Dec 14, 2022
aa50d13
Use correct composer version.
anton-vlasenko Dec 14, 2022
c67c5b6
Fix container name.
anton-vlasenko Dec 14, 2022
9575fc7
Don't modify package.json.
anton-vlasenko Dec 14, 2022
4d6bdd4
Don't install composer dependencies twice.
anton-vlasenko Dec 14, 2022
461200f
Need to prefix commands with npm run.
anton-vlasenko Dec 14, 2022
b299003
Add double dashes to pass flags to wp-env.
anton-vlasenko Dec 14, 2022
d722186
Fix name of the environment.
anton-vlasenko Dec 14, 2022
8c774d0
Add additional debug information.
anton-vlasenko Dec 14, 2022
4319bac
Composer dependencies should be installed after wp-env is intialised.
anton-vlasenko Dec 14, 2022
b245bc6
Fix wrong command.
anton-vlasenko Dec 14, 2022
6057268
Since the tests are currently run within the Docker containers where …
anton-vlasenko Dec 14, 2022
f8173c6
Fix path to the multisite.xml.
anton-vlasenko Dec 14, 2022
0b8dff9
Fix the test class to be compatible with PHP < 7.3.
anton-vlasenko Dec 14, 2022
2fbdcc4
Fix bug in WP_REST_Block_Pattern_Categories_Controller_Test::wpTearDo…
anton-vlasenko Dec 14, 2022
76fcd32
Remove incompatible PHP packages.
anton-vlasenko Dec 15, 2022
82745d8
Remove incompatible PHP packages.
anton-vlasenko Dec 15, 2022
db2044e
Update description.
anton-vlasenko Dec 15, 2022
460da7c
Remove incompatible PHP packages.
anton-vlasenko Dec 15, 2022
1f607b5
Remove incompatible PHP packages.
anton-vlasenko Dec 15, 2022
d90b2fc
Fix wrong matrix value.
anton-vlasenko Dec 15, 2022
61a096f
Remove incompatible PHP packages.
anton-vlasenko Dec 15, 2022
8232cd1
Don't remove polyfills.
anton-vlasenko Dec 15, 2022
5dfa520
Don't remove spathie package on PHP 7.2.
anton-vlasenko Dec 15, 2022
bc9af74
// strpos() doesn't support negative offset values on PHP prior to ve…
anton-vlasenko Dec 15, 2022
185f26a
Add cliPhpVersion config parameter.
anton-vlasenko Dec 15, 2022
118286f
Don't use custom commands to run the tests.
anton-vlasenko Dec 15, 2022
7abd2c3
Revert "Add cliPhpVersion config parameter."
anton-vlasenko Dec 15, 2022
a6d2aee
Don't use the phpunit docker-compose service.
anton-vlasenko Dec 15, 2022
5890fb6
Fix dynamic properties. PHP 8.2 doesn't support dynamic properties.
anton-vlasenko Dec 15, 2022
be706c6
Fix dynamic properties. PHP 8.2 doesn't support dynamic properties.
anton-vlasenko Dec 15, 2022
d44e9fa
Fix dynamic properties. PHP 8.2 doesn't support dynamic properties.
anton-vlasenko Dec 15, 2022
780e12e
Allow /.cache/.gitkeep files.
anton-vlasenko Dec 16, 2022
1cbe0ee
Add the .gitkeep file.
anton-vlasenko Dec 16, 2022
f1cb171
Add PHP Coding Stadnards.
anton-vlasenko Dec 16, 2022
2d5e7f0
Fix the if condition.
anton-vlasenko Dec 16, 2022
1636e2d
Fix path.
anton-vlasenko Dec 16, 2022
f9dfc91
Rename Core to Gutenberg.
anton-vlasenko Dec 20, 2022
10e5d0f
Add job's description.
anton-vlasenko Dec 20, 2022
31d5f22
Add a comment to explain why we need the /.cache folder.
anton-vlasenko Dec 20, 2022
5c92300
Add a comment to explain why we need complicated .gitignore rules.
anton-vlasenko Dec 20, 2022
c16e8e5
Fix grammar.
anton-vlasenko Dec 20, 2022
9ac9073
Revert accidental changes.
anton-vlasenko Dec 20, 2022
1b0d068
Revert accidental changes.
anton-vlasenko Dec 20, 2022
bb0f4b7
Allow manually triggering the workflows.
anton-vlasenko Dec 22, 2022
3c90728
Remove description.
anton-vlasenko Dec 22, 2022
220bf63
Let's not limit the job by path.
anton-vlasenko Dec 22, 2022
6f158a7
PHP 7.3 and 7.4 should use PHPUnit 9.
anton-vlasenko Dec 22, 2022
76a5d0e
Update the changelog.
anton-vlasenko Jan 12, 2023
c1bf302
1. Fix yaml synthax.
anton-vlasenko Dec 22, 2022
9c91766
In most repos, the convention is to have the if: above the run:.
anton-vlasenko Dec 22, 2022
571f5ee
Don't log the PHP version; this information is available in the "Set …
anton-vlasenko Dec 22, 2022
a4c17e4
Don't log the Composer version; this information is available in the …
anton-vlasenko Dec 22, 2022
8b7348b
1. Don't scan the unit tests twice.
anton-vlasenko Dec 22, 2022
c46a898
Fix the cs2pr report location.
anton-vlasenko Dec 22, 2022
2be51c6
Update the .gitignore rule description.
anton-vlasenko Dec 22, 2022
ac99768
Enable fast failing to save Github resources as proposed here: https:…
anton-vlasenko Jan 4, 2023
22bffeb
As the separate PHPCS run for the tests has been removed, this step s…
anton-vlasenko Jan 12, 2023
7cfdaae
Use the development php.ini file (to make any errors more obvious).
anton-vlasenko Jan 12, 2023
8546c9c
Use the development php.ini file (to make any errors more obvious).
anton-vlasenko Jan 12, 2023
9d0a477
Revert "Use the development php.ini file (to make any errors more obv…
anton-vlasenko Jan 12, 2023
2a371d8
Move the unit tests to unit-test.yml.
anton-vlasenko Jan 12, 2023
8eb3280
Change the description.
anton-vlasenko Jan 16, 2023
017ce16
Rename the job.
anton-vlasenko Jan 16, 2023
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
Empty file added .cache/.gitkeep
Empty file.
162 changes: 152 additions & 10 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
- trunk
- 'release/**'
- 'wp/**'
# Allow manually triggering the workflow.
workflow_dispatch:

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
Expand Down Expand Up @@ -51,39 +53,179 @@ jobs:
- name: Running the date tests
run: npm run test:unit:date -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache"

unit-php:
name: PHP
test-php:
name: PHP ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }} on ubuntu-latest
runs-on: ubuntu-latest
timeout-minutes: 20
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
strategy:
fail-fast: true
matrix:
php:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
multisite: [false, true]

env:
WP_ENV_PHP_VERSION: ${{ matrix.php }}

steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0

- name: Use desired version of NodeJS
- name: Set up Node.js
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
with:
node-version-file: '.nvmrc'
cache: npm

- name: Npm install and build
##
# This allows Composer dependencies to be installed using a single step.
#
# Since the tests are currently run within the Docker containers where the PHP version varies,
# the same PHP version needs to be configured for the action runner machine so that the correct
# dependency versions are installed and cached.
##
- name: Set up PHP
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2.22.0
with:
php-version: '${{ matrix.php }}'
ini-file: development
coverage: none

# Ensure that Composer installs the correct versions of packages.
- name: Override PHP version in composer.json
run: composer config platform.php ${{ matrix.php }}

# The spatie/phpunit-watcher package is not compatible with PHP < 7.2.
# It must be removed before running the tests.
- name: Remove incompatible Composer packages
if: ${{ matrix.php < '7.2' }}
run: composer remove spatie/phpunit-watcher --dev --no-update

# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
- name: Install Composer dependencies
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
with:
custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F")

- name: Install npm dependencies
run: |
npm ci
npm run build

- name: Install WordPress
- name: Docker debug information
run: |
npm run wp-env start
docker -v
docker-compose -v

- name: Running lint check
run: npm run lint:php
- name: General debug information
run: |
npm --version
node --version
curl --version
git --version
svn --version
locale -a

- name: Start Docker environment
run: npm run wp-env start

- name: Log running Docker containers
run: docker ps -a

- name: Docker container debug information
run: |
npm run wp-env run tests-mysql "mysql --version"
npm run wp-env run tests-wordpress "php --version"
npm run wp-env run tests-wordpress "php -m"
npm run wp-env run tests-wordpress "php -i"
npm run wp-env run tests-wordpress "/var/www/html/wp-content/plugins/gutenberg/vendor/bin/phpunit --version"
npm run wp-env run tests-wordpress "locale -a"

- name: Running single site unit tests
if: ${{ ! matrix.multisite }}
run: npm run test:unit:php
if: ${{ success() || failure() }}

- name: Running multisite unit tests
if: ${{ matrix.multisite }}
run: npm run test:unit:php:multisite
if: ${{ success() || failure() }}

phpcs:
name: PHP coding standards
runs-on: ubuntu-latest
timeout-minutes: 20
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}

steps:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0

- name: Set up PHP
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2.22.0
with:
php-version: '7.4'
coverage: none
tools: cs2pr

# This date is used to ensure that the PHPCS cache is cleared at least once every week.
# http://man7.org/linux/man-pages/man1/date.1.html
- name: "Get last Monday's date"
id: get-date
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT

- name: Cache PHPCS scan cache
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
with:
path: .cache/phpcs.json
key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }}

# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
- name: Install Composer dependencies
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
with:
custom-cache-suffix: ${{ steps.get-date.outputs.date }}

- name: Make Composer packages available globally
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH

- name: Run PHPCS on all Gutenberg files
id: phpcs-gutenberg
run: phpcs --report-full --report-checkstyle=./.cache/phpcs-report.xml

- name: Show PHPCS results in PR
if: ${{ always() && steps.phpcs-gutenberg.outcome == 'failure' }}
run: cs2pr ./.cache/phpcs-report.xml

- name: Ensure version-controlled files are not modified during the tests
run: git diff --exit-code

# This job is deprecated but be present for compatibility reasons.
unit-php:
name: PHP
runs-on: ubuntu-latest
needs: [test-php, phpcs]
if: ${{ always() }}
steps:
- name: Fail the job if the PHPUnit tests fail
if: ${{ needs.test-php.result != 'success' }}
run: exit 1

- name: "Fail the job if the code doesn't conform to the coding standards"
if: ${{ needs.phpcs.result != 'success' }}
run: exit 1

- name: Mark the job as passed if all the checks pass
if: ${{ needs.test-php.result == 'success' && needs.phpcs.result == 'success' }}
run: exit 0

mobile-unit-js:
name: Mobile
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ yarn.lock
/perf-envs
/composer.lock

# The /.cache folder is needed for phpcs to cache results between runs, while other .cache folders must be ignored
# It is not possible to re-include a file if a parent directory of that file is excluded
# So, both /.cache and /.cache./.gitkeep must be re-included
.cache
!/.cache/
/.cache/**
!/.cache/.gitkeep
Copy link
Contributor Author

@anton-vlasenko anton-vlasenko Dec 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ignores all .cache/.gitkeep files but /.cache/.gitkeep.
The /.cache/ folder is needed for the PHP Coding Standards CI job.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This deserves an explanatory comment inline as it's going to be really hard to find this PR comment when someone is trying to understand why the .cache directory is so zig-zagged here. Can we add the explanation, and include why a simpler formulation of the rules cannot provide what we need?

Is it not possible to have PHP Coding Standards use another directory? What is the reason for its use of .cache here anyway?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also now see that we're telling git to keep the .cache directory, which seems surprising to me. why do we need to do this?

if this weren't .gitkeep'd then this surprising change to .gitignore presumably would also not be necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for zig-zagging is the following:

It is not possible to re-include a file if a parent directory of that file is excluded. 

This deserves an explanatory comment inline as it's going to be really hard to find this PR comment when someone is trying to understand why the .cache directory is so zig-zagged here.

I agree. Fixed in 89a4d738e13c7d6ff51d54cfa2477eb0c713c67b

Currently, Gutenberg ignores all .cache folders (regardless of their location).
For compatibility reasons, these folders should still be ignored, while allowing the /.cache folder (in the root).
I haven't been able to come up with a simpler pattern that would allow that.

if this weren't .gitkeep'd then this surprising change to .gitignore presumably would also not be necessary

Git doesn't allow to commit empty folders. If it did, I would commit an empty folder.

Is it not possible to have PHP Coding Standards use another directory? What is the reason for its use of .cache here anyway?

Yes, it's possible, but I don't understand what's wrong with /.cache.

A similar Core job uses a folder with the same name - .cache.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure but why do we need or want to commit an empty directory?

Copy link
Member

@jrfnl jrfnl Dec 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because PHPCS expects the directory to which to write the cache file to exist. It will not create it.

So if the ruleset dictates that the cache file should be written to the .cache directory, that directory must exist as otherwise PHPCS will error out.
You could, of course, choose to just let the cache file be written to the system temp directory or to the project root...

Note: the PHPCS cache file itself should definitely be gitignored.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my suspicion was that it was something like this, but if that's the case, that doesn't explain why it needs to be in git, it merely notes that the directory needs to be present when running the linter.

if the entire purpose of coercing git to include an empty directory in the repo is so that a linter can run in CI then it would be simpler to create the directory when running the CI script with mkdir -p .cache or the equivalent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, that depends. If the ruleset contains the cache directive, local CS runs will also expect the directory.

If the caching is only used in CI, I agree, a mkdir would suffice, but then again, why would the caching be limited to CI ?

Also note - in most projects which use a .cache directory for the PHPCS cache placement, it is generally because they want to cache those files in CI and Travis (yes, that's the completely outdated reason), didn't allow for caching individual files, only allowed for caching directories, which is why people resorted to having a .cache directory for this.

GH Actions, however, does allow for caching individual files, so I honestly don't know why that .cache directory is still used, especially for projects setting this up from scratch. (I can understand people not having revisited their previous reason for setting it up when converting from Travis to GHA, but that's not the case here)


.eslintcache
*.tsbuildinfo

Expand Down
6 changes: 6 additions & 0 deletions packages/env/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

### Bug fix
- PHP 7.3 and 7.4 must use PHPUnit 9.

### Enhancement
- It's now possible to run PHPUnit tests on PHP 8.1 and 8.2.

## 5.9.0 (2023-01-02)

## 5.8.0 (2022-12-14)
Expand Down
6 changes: 4 additions & 2 deletions packages/env/lib/build-docker-compose-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,11 @@ module.exports = function buildDockerComposeConfig( config ) {
phpunitTag = '6' + phpunitPhpVersion;
} else if ( testsPhpVersion === '7.1' ) {
phpunitTag = '7' + phpunitPhpVersion;
} else if ( [ '7.2', '7.3', '7.4' ].indexOf( testsPhpVersion ) >= 0 ) {
} else if ( testsPhpVersion === '7.2' ) {
phpunitTag = '8' + phpunitPhpVersion;
} else if ( testsPhpVersion === '8.0' ) {
} else if (
[ '7.3', '7.4', '8.0', '8.1', '8.2' ].indexOf( testsPhpVersion ) >= 0
) {
phpunitTag = '9' + phpunitPhpVersion;
}
const phpunitImage = `wordpressdevelop/phpunit:${ phpunitTag }`;
Expand Down
3 changes: 3 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
<arg value="ps"/>
<arg name="extensions" value="php"/>

<!-- Cache the scan results and re-use those for unchanged files on the next scan. -->
<arg name="cache" value=".cache/phpcs.json"/>

<file>./bin</file>
<file>./gutenberg.php</file>
<file>./lib</file>
Expand Down
15 changes: 15 additions & 0 deletions phpunit/block-supports/layout-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@
*/

class WP_Block_Supports_Layout_Test extends WP_UnitTestCase {
/**
* @var string|null
*/
private $theme_root;

/**
* @var array|null
*/
private $orig_theme_dir;

/**
* @var array|null
*/
private $queries;

anton-vlasenko marked this conversation as resolved.
Show resolved Hide resolved
public function set_up() {
parent::set_up();
$this->theme_root = realpath( __DIR__ . '/../data/themedir1' );
Expand Down
27 changes: 19 additions & 8 deletions phpunit/class-wp-rest-block-pattern-categories-controller-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
class WP_REST_Block_Pattern_Categories_Controller_Test extends WP_Test_REST_Controller_Testcase {
protected static $admin_id;
protected static $orig_registry;
protected static $original_instance_value;

public function set_up() {
parent::set_up();
Expand All @@ -26,11 +26,13 @@ public static function wpSetupBeforeClass( $factory ) {
self::$admin_id = $factory->user->create( array( 'role' => 'administrator' ) );

// Setup an empty testing instance of `WP_Block_Pattern_Categories_Registry` and save the original.
$reflection = new ReflectionClass( 'WP_Block_Pattern_Categories_Registry' );
$reflection->getProperty( 'instance' )->setAccessible( true );
self::$orig_registry = $reflection->getStaticPropertyValue( 'instance' );
$test_registry = new WP_Block_Pattern_Categories_Registry();
$reflection->setStaticPropertyValue( 'instance', $test_registry );
$reflection = new ReflectionClass( 'WP_Block_Pattern_Categories_Registry' );
$instance_property = $reflection->getProperty( 'instance' );
$instance_property->setAccessible( true );
self::$original_instance_value = $instance_property->getValue( null );

$test_registry = new WP_Block_Pattern_Categories_Registry();
$instance_property->setValue( $test_registry );

// Register some categories in the test registry.
$test_registry->register( 'test', array( 'label' => 'Test' ) );
Expand All @@ -42,8 +44,11 @@ public static function wpTearDownAfterClass() {
self::delete_user( self::$admin_id );

// Restore the original registry instance.
$reflection = new ReflectionClass( 'WP_Block_Pattern_Categories_Registry' );
$reflection->setStaticPropertyValue( 'instance', self::$orig_registry );
$reflection = new ReflectionClass( 'WP_Block_Pattern_Categories_Registry' );
$instance_property = $reflection->getProperty( 'instance' );
$instance_property->setAccessible( true );
$instance_property->setValue( self::$original_instance_value );
$instance_property->setAccessible( false );
}

public function test_register_routes() {
Expand Down Expand Up @@ -79,21 +84,27 @@ public function test_get_items() {
public function test_context_param() {
$this->markTestIncomplete();
}

public function test_get_item() {
$this->markTestIncomplete();
}

public function test_create_item() {
$this->markTestIncomplete();
}

public function test_update_item() {
$this->markTestIncomplete();
}

public function test_delete_item() {
$this->markTestIncomplete();
}

public function test_prepare_item() {
$this->markTestIncomplete();
}

public function test_get_item_schema() {
$this->markTestIncomplete();
}
Expand Down
15 changes: 15 additions & 0 deletions phpunit/class-wp-theme-json-resolver-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,21 @@ class WP_Theme_JSON_Resolver_Gutenberg_Test extends WP_UnitTestCase {
*/
private static $property_core_orig_value;

/**
* @var string|null
*/
private $theme_root;

/**
* @var array|null
*/
private $orig_theme_dir;

/**
* @var array|null
*/
private $queries;

public static function set_up_before_class() {
parent::set_up_before_class();

Expand Down
14 changes: 14 additions & 0 deletions phpunit/wp-theme-json-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@
*/

class WP_Theme_Json_Test extends WP_UnitTestCase {
/**
* @var string|null
*/
private $theme_root;

/**
* @var array|null
*/
private $orig_theme_dir;

/**
* @var array|null
*/
private $queries;

public function set_up() {
parent::set_up();
Expand Down