mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Build/Test Tools: Run the Ajax test group for multisite.
This will help catch issues with Ajax related functionality on multisite. A few tests have also been marked as `skipWithMultisite()` as they require network admin level capabilities when performing the same operations on a multisite install. Props garrett-eclipse, netweb. Fixes #46567. git-svn-id: https://develop.svn.wordpress.org/trunk@49835 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8bc7e0c0e5
commit
3723941a9c
3
.github/workflows/phpunit-tests.yml
vendored
3
.github/workflows/phpunit-tests.yml
vendored
@ -257,6 +257,9 @@ jobs:
|
||||
- name: Run tests as a multisite install
|
||||
run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml
|
||||
|
||||
- name: Run AJAX tests as a multisite install
|
||||
run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml --group ajax
|
||||
|
||||
- name: Run ms-files tests as a multisite install
|
||||
run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml --group ms-files
|
||||
|
||||
|
||||
@ -673,6 +673,10 @@ module.exports = function(grunt) {
|
||||
cmd: 'phpunit',
|
||||
args: ['--verbose', '-c', 'tests/phpunit/multisite.xml']
|
||||
},
|
||||
'ms-ajax': {
|
||||
cmd: 'phpunit',
|
||||
args: ['--verbose', '-c', 'tests/phpunit/multisite.xml', '--group', 'ajax']
|
||||
},
|
||||
'ms-files': {
|
||||
cmd: 'phpunit',
|
||||
args: ['--verbose', '-c', 'tests/phpunit/multisite.xml', '--group', 'ms-files']
|
||||
|
||||
@ -65,6 +65,8 @@ class Tests_Ajax_Attachments extends WP_Ajax_UnitTestCase {
|
||||
* @ticket 36578
|
||||
*/
|
||||
public function test_wp_ajax_send_attachment_to_editor_should_return_a_link() {
|
||||
$this->skipWithMultisite();
|
||||
|
||||
// Become an administrator.
|
||||
$post = $_POST;
|
||||
$user_id = self::factory()->user->create(
|
||||
|
||||
@ -126,6 +126,7 @@ class Tests_Ajax_Delete_Plugin extends WP_Ajax_UnitTestCase {
|
||||
}
|
||||
|
||||
public function test_delete_plugin() {
|
||||
$this->skipWithMultisite();
|
||||
$this->_setRole( 'administrator' );
|
||||
|
||||
$_POST['_ajax_nonce'] = wp_create_nonce( 'updates' );
|
||||
|
||||
@ -102,6 +102,7 @@ class Tests_Ajax_Manage_Themes extends WP_Ajax_UnitTestCase {
|
||||
}
|
||||
|
||||
public function test_update_theme() {
|
||||
$this->skipWithMultisite();
|
||||
$this->_setRole( 'administrator' );
|
||||
|
||||
$_POST['_ajax_nonce'] = wp_create_nonce( 'updates' );
|
||||
@ -139,6 +140,7 @@ class Tests_Ajax_Manage_Themes extends WP_Ajax_UnitTestCase {
|
||||
}
|
||||
|
||||
function test_uppercase_theme_slug() {
|
||||
$this->skipWithMultisite();
|
||||
$this->_setRole( 'administrator' );
|
||||
|
||||
$_POST['_ajax_nonce'] = wp_create_nonce( 'updates' );
|
||||
|
||||
@ -130,6 +130,7 @@ class Tests_Ajax_Update_Plugin extends WP_Ajax_UnitTestCase {
|
||||
}
|
||||
|
||||
public function test_update_plugin() {
|
||||
$this->skipWithMultisite();
|
||||
$this->_setRole( 'administrator' );
|
||||
|
||||
$_POST['_ajax_nonce'] = wp_create_nonce( 'updates' );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user