Make WordPress Core

Changeset 31003


Ignore:
Timestamp:
12/30/2014 07:30:07 PM (10 years ago)
Author:
boonebgorges
Message:

When no plugins are active, return an empty array from validate_active_plugins().

This creates parity with the behavior of the function when plugins *are* active,
but none are invalid. It also makes it possible to write unit tests for the
function.

Props sgrant.
Fixes #30860.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin.php

    r30668 r31003  
    885885
    886886    if ( empty( $plugins ) )
    887         return;
     887        return array();
    888888
    889889    $invalid = array();
  • trunk/tests/phpunit/tests/admin/includesPlugin.php

    r31002 r31003  
    294294
    295295    /**
     296     * @covers ::validate_active_plugins
     297     */
     298    public function test_validate_active_plugins_empty() {
     299        $this->assertEquals( array(), validate_active_plugins() );
     300    }
     301
     302    /**
    296303     * @covers ::is_uninstallable_plugin
    297304     */
Note: See TracChangeset for help on using the changeset viewer.