<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][13720] trunk: Update `wp-env` to version 9.0.0 & adapt the PHPUnit tests suite to it</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/13720">13720</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/13720","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>imath</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-01-31 20:09:06 +0000 (Wed, 31 Jan 2024)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Update `wp-env` to version 9.0.0 & adapt the PHPUnit tests suite to it
- Update PHPUnit related npm scripts for `wp-env` 9.0.0.
- Create `test_multi`: a new composer script to run Multisite Unit tests.
- Remove our composer dependency to `wp-phpunit/wp-phpunit`.
- Update the PHPUnit tests suite so that it stops using `wp-phpunit/wp-phpunit` when it's within the `wp-env` context.
- Remove no more used PHPUnit specific configuration files.
Fixes <a href="http://buddypress.trac.wordpress.org/ticket/9053">#9053</a>
Closes https://github.com/buddypress/buddypress/pull/211</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkcomposerjson">trunk/composer.json</a></li>
<li><a href="#trunknpmshrinkwrapjson">trunk/npm-shrinkwrap.json</a></li>
<li><a href="#trunkpackagejson">trunk/package.json</a></li>
<li><a href="#trunktestsphpunitbootstrapphp">trunk/tests/phpunit/bootstrap.php</a></li>
<li><a href="#trunktestsphpunitincludesdefineconstantsphp">trunk/tests/phpunit/includes/define-constants.php</a></li>
<li><a href="#trunktestsphpunittestcasescorefunctionsphp">trunk/tests/phpunit/testcases/core/functions.php</a></li>
<li><a href="#trunktestsphpunittestcasesroutingmembersphp">trunk/tests/phpunit/testcases/routing/members.php</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunktestsphpunitenvmultisitexml">trunk/tests/phpunit/env.multisite.xml</a></li>
<li><a href="#trunktestsphpunitenvxml">trunk/tests/phpunit/env.xml</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkcomposerjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/composer.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/composer.json 2024-01-30 05:38:27 UTC (rev 13719)
+++ trunk/composer.json 2024-01-31 20:09:06 UTC (rev 13720)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,11 +46,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "require-dev": {
</span><span class="cx" style="display: block; padding: 0 10px"> "buddypress/bp-coding-standards": "dev-trunk",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "wp-phpunit/wp-phpunit": "^6.4",
</del><span class="cx" style="display: block; padding: 0 10px"> "yoast/phpunit-polyfills": "^1.0"
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "scripts": {
</span><span class="cx" style="display: block; padding: 0 10px"> "test": "@php ./vendor/phpunit/phpunit/phpunit",
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "test_multi": "@php ./vendor/phpunit/phpunit/phpunit -c tests/phpunit/multisite.xml",
</ins><span class="cx" style="display: block; padding: 0 10px"> "phpcs": "@php ./vendor/bin/phpcs"
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunknpmshrinkwrapjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/npm-shrinkwrap.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/npm-shrinkwrap.json 2024-01-30 05:38:27 UTC (rev 13719)
+++ trunk/npm-shrinkwrap.json 2024-01-31 20:09:06 UTC (rev 13720)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,7 +11,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "devDependencies": {
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/babel-preset-default": "^7.32.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/browserslist-config": "^5.31.0",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "@wordpress/env": "^5.6.0",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "@wordpress/env": "^9.0.0",
</ins><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/scripts": "^26.19.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/stylelint-config": "~19.1.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "autoprefixer": "^9.8.8",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5030,14 +5030,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "node_modules/@wordpress/env": {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": "5.16.0",
- "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-5.16.0.tgz",
- "integrity": "sha512-zx6UO8PuJBrQ34cfeedK1HlGHLFaj7oWzTo9tTt+noB79Ttqc4+a0lYwDqBLLJhlHU+cWgcyOP2lB6TboXH0xA==",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-9.0.0.tgz",
+ "integrity": "sha512-Fyec0k5N7kaXVIpTnJ2zO/n3CIiq8cPDsUaFoLVKI+yv2cVuq1dSQyc1lLXB9Gu+SNvmfbq7nNVVmNfKgpAkrw==",
</ins><span class="cx" style="display: block; padding: 0 10px"> "dev": true,
</span><span class="cx" style="display: block; padding: 0 10px"> "dependencies": {
</span><span class="cx" style="display: block; padding: 0 10px"> "chalk": "^4.0.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "copy-dir": "^1.3.0",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "docker-compose": "^0.22.2",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "docker-compose": "^0.24.3",
</ins><span class="cx" style="display: block; padding: 0 10px"> "extract-zip": "^1.6.7",
</span><span class="cx" style="display: block; padding: 0 10px"> "got": "^11.8.5",
</span><span class="cx" style="display: block; padding: 0 10px"> "inquirer": "^7.1.0",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11115,10 +11115,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "node_modules/docker-compose": {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "version": "0.22.2",
- "resolved": "https://registry.npmjs.org/docker-compose/-/docker-compose-0.22.2.tgz",
- "integrity": "sha512-iXWb5+LiYmylIMFXvGTYsjI1F+Xyx78Jm/uj1dxwwZLbWkUdH6yOXY5Nr3RjbYX15EgbGJCq78d29CmWQQQMPg==",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "version": "0.24.3",
+ "resolved": "https://registry.npmjs.org/docker-compose/-/docker-compose-0.24.3.tgz",
+ "integrity": "sha512-x3/QN3AIOMe7j2c8f/jcycizMft7dl8MluoB9OGPAYCyKHHiPUFqI9GjCcsU0kYy24vYKMCcfR6+5ZaEyQlrxg==",
</ins><span class="cx" style="display: block; padding: 0 10px"> "dev": true,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "dependencies": {
+ "yaml": "^2.2.2"
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> "engines": {
</span><span class="cx" style="display: block; padding: 0 10px"> "node": ">= 6.0.0"
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31451,6 +31454,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
</span><span class="cx" style="display: block; padding: 0 10px"> "dev": true
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "node_modules/yaml": {
+ "version": "2.3.4",
+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz",
+ "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==",
+ "dev": true,
+ "engines": {
+ "node": ">= 14"
+ }
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> "node_modules/yargs": {
</span><span class="cx" style="display: block; padding: 0 10px"> "version": "17.7.2",
</span><span class="cx" style="display: block; padding: 0 10px"> "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
</span></span></pre></div>
<a id="trunkpackagejson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/package.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/package.json 2024-01-30 05:38:27 UTC (rev 13719)
+++ trunk/package.json 2024-01-31 20:09:06 UTC (rev 13720)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,7 +8,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/babel-preset-default": "^7.32.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/browserslist-config": "^5.31.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/scripts": "^26.19.0",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "@wordpress/env": "^5.6.0",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "@wordpress/env": "^9.0.0",
</ins><span class="cx" style="display: block; padding: 0 10px"> "@wordpress/stylelint-config": "~19.1.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "autoprefixer": "^9.8.8",
</span><span class="cx" style="display: block; padding: 0 10px"> "grunt": "^1.6.1",
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,10 +51,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "build:block:messages": "wp-scripts build --webpack-src-dir=src/js/blocks/bp-messages --config src/js/blocks/bp-messages/webpack.config.js",
</span><span class="cx" style="display: block; padding: 0 10px"> "build:admin": "wp-scripts build --webpack-src-dir=src/js/admin --config src/js/admin/webpack.config.js && grunt move:admin:js",
</span><span class="cx" style="display: block; padding: 0 10px"> "wp-env": "wp-env",
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "test-php": "npm run wp-env run phpunit 'php /var/www/html/wp-content/plugins/buddypress/vendor/phpunit/phpunit/phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.xml'",
- "test-php:group": "npm run wp-env run phpunit 'php /var/www/html/wp-content/plugins/buddypress/vendor/phpunit/phpunit/phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.xml --group $npm_confi_g'",
- "test-php-multisite": "npm run wp-env run phpunit 'php /var/www/html/wp-content/plugins/buddypress/vendor/phpunit/phpunit/phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.multisite.xml'",
- "test-php-multisite:group": "npm run wp-env run phpunit 'php /var/www/html/wp-content/plugins/buddypress/vendor/phpunit/phpunit/phpunit -c /var/www/html/wp-content/plugins/buddypress/tests/phpunit/env.multisite.xml --group $npm_confi_g'",
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "test-php": "npm run wp-env run cli -- --env-cwd=wp-content/plugins/buddypress composer test",
+ "test-php:group": "npm run wp-env run cli -- --env-cwd=wp-content/plugins/buddypress composer test -- -- --group ",
+ "test-php-multisite": "npm run wp-env run cli -- --env-cwd=wp-content/plugins/buddypress composer test_multi",
+ "test-php-multisite:group": "npm run wp-env run cli -- --env-cwd=wp-content/plugins/buddypress composer test_multi -- -- --group ",
</ins><span class="cx" style="display: block; padding: 0 10px"> "download:cli": "curl -L -o 'cli-archive.zip' https://github.com/buddypress/wp-cli-buddypress/archive/2.0.2.zip && unzip -qq cli-archive.zip && mv wp-cli-buddypress-2.0.2 build/cli && rm cli-archive.zip",
</span><span class="cx" style="display: block; padding: 0 10px"> "download:rest": "curl -L -o 'rest-archive.zip' https://github.com/buddypress/BP-REST/archive/master.zip && unzip -qq rest-archive.zip && mv BP-REST-master build/bp-rest && rm rest-archive.zip"
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span></span></pre></div>
<a id="trunktestsphpunitbootstrapphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/bootstrap.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/bootstrap.php 2024-01-30 05:38:27 UTC (rev 13719)
+++ trunk/tests/phpunit/bootstrap.php 2024-01-31 20:09:06 UTC (rev 13720)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,15 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> const WP_TESTS_PHPUNIT_POLYFILLS_PATH = __DIR__ . '/../../vendor/yoast/phpunit-polyfills';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( defined( 'BP_USE_WP_ENV_TESTS' ) ) {
- // wp-env setup.
- define( 'WP_TESTS_CONFIG_FILE_PATH', dirname( __FILE__ ) . '/assets/phpunit-wp-config.php' );
- define( 'WP_TESTS_CONFIG_PATH', WP_TESTS_CONFIG_FILE_PATH );
-
- // Use WP PHPUnit.
- require_once dirname( dirname( dirname( __FILE__ ) ) ) . '/vendor/wp-phpunit/wp-phpunit/__loaded.php';
-}
-
</del><span class="cx" style="display: block; padding: 0 10px"> require( dirname( __FILE__ ) . '/includes/define-constants.php' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! file_exists( WP_TESTS_DIR . '/includes/functions.php' ) ) {
</span></span></pre></div>
<a id="trunktestsphpunitenvmultisitexml"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/env.multisite.xml</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/env.multisite.xml 2024-01-30 05:38:27 UTC (rev 13719)
+++ trunk/tests/phpunit/env.multisite.xml 2024-01-31 20:09:06 UTC (rev 13720)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,18 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<phpunit
- bootstrap="bootstrap.php"
- backupGlobals="false"
- colors="true"
- convertErrorsToExceptions="true"
- convertNoticesToExceptions="true"
- convertWarningsToExceptions="true"
- >
- <php>
- <const name="WP_TESTS_MULTISITE" value="1" />
- <const name="BP_USE_WP_ENV_TESTS" value="1" />
- </php>
- <testsuites>
- <testsuite name="default">
- <directory suffix=".php">./testcases/</directory>
- </testsuite>
- </testsuites>
-</phpunit>
</del></span></pre></div>
<a id="trunktestsphpunitenvxml"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: trunk/tests/phpunit/env.xml</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/env.xml 2024-01-30 05:38:27 UTC (rev 13719)
+++ trunk/tests/phpunit/env.xml 2024-01-31 20:09:06 UTC (rev 13720)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,17 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<phpunit
- bootstrap="bootstrap.php"
- backupGlobals="false"
- colors="true"
- convertErrorsToExceptions="true"
- convertNoticesToExceptions="true"
- convertWarningsToExceptions="true"
- >
- <php>
- <const name="BP_USE_WP_ENV_TESTS" value="1" />
- </php>
- <testsuites>
- <testsuite name="default">
- <directory suffix=".php">./testcases/</directory>
- </testsuite>
- </testsuites>
-</phpunit>
</del></span></pre></div>
<a id="trunktestsphpunitincludesdefineconstantsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/includes/define-constants.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/includes/define-constants.php 2024-01-30 05:38:27 UTC (rev 13719)
+++ trunk/tests/phpunit/includes/define-constants.php 2024-01-31 20:09:06 UTC (rev 13720)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,10 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * - Assume that we are inside of a develop.svn.wordpress.org setup, and walk
</span><span class="cx" style="display: block; padding: 0 10px"> * up the directory tree
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( false !== getenv( 'WP_PHPUNIT__DIR' ) && defined( 'BP_USE_WP_ENV_TESTS' ) ) {
- define( 'WP_TESTS_DIR', getenv( 'WP_PHPUNIT__DIR' ) );
- define( 'WP_ROOT_DIR', '/var/www/html' );
-} elseif ( false !== getenv( 'WP_TESTS_DIR' ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if ( false !== getenv( 'WP_TESTS_DIR' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> define( 'WP_TESTS_DIR', getenv( 'WP_TESTS_DIR' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> define( 'WP_ROOT_DIR', WP_TESTS_DIR );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span></span></pre></div>
<a id="trunktestsphpunittestcasescorefunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/testcases/core/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/testcases/core/functions.php 2024-01-30 05:38:27 UTC (rev 13719)
+++ trunk/tests/phpunit/testcases/core/functions.php 2024-01-31 20:09:06 UTC (rev 13720)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -833,6 +833,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $bp = buddypress();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $reset_current_site = isset( $GLOBALS['current_site'] ) ? $GLOBALS['current_site'] : null;
</ins><span class="cx" style="display: block; padding: 0 10px"> $reset_bp_pages = $bp->pages;
</span><span class="cx" style="display: block; padding: 0 10px"> $reset_bp_active_components = $bp->active_components;
</span><span class="cx" style="display: block; padding: 0 10px"> $reset_option = bp_get_option( 'bp-pages' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -841,6 +842,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'path' => '/newcomponent/',
</span><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( defined( 'WP_HOME' ) ) {
+ $GLOBALS['current_site']->domain = get_site( $b )->domain;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $bp->active_components['newcomponent'] = 1;
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'bp_core_get_directory_page_default_titles', array( $this, 'add_newcomponent_page_title' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -850,6 +855,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $bp_pages = bp_get_option( 'bp-pages' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $new_component_page_id = $bp_pages['newcomponent'];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotSame( 'newcomponent', get_post_field( 'post_name', $new_component_page_id ), 'The component slug should not conflict with subsite name.' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Reset the page mapping.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -857,6 +863,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_delete_post( $bp_pages['newcomponent'], true );
</span><span class="cx" style="display: block; padding: 0 10px"> $bp->pages = $reset_bp_pages;
</span><span class="cx" style="display: block; padding: 0 10px"> $bp->active_components = $reset_bp_active_components;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( defined( 'WP_HOME' ) ) {
+ $GLOBALS['current_site'] = $reset_current_site;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function add_newcomponent_page_title( $page_default_titles = array() ) {
</span></span></pre></div>
<a id="trunktestsphpunittestcasesroutingmembersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/testcases/routing/members.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/testcases/routing/members.php 2024-01-30 05:38:27 UTC (rev 13719)
+++ trunk/tests/phpunit/testcases/routing/members.php 2024-01-31 20:09:06 UTC (rev 13720)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,7 +64,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> remove_filter( 'bp_members_member_type_base', array( $this, 'filter_member_type_base' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->assertSame( $url, 'http://example.org/members/bp-member-type/foo/' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->assertSame( $url, 'http://' . trailingslashit( WP_TESTS_DOMAIN ) . 'members/bp-member-type/foo/' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> public function filter_member_type_base( $base ) {
</span></span></pre>
</div>
</div>
</body>
</html>