Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Sep 7, 2023
1 parent 1697d39 commit 539dad7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/phpunit/tests/admin/wpPluginDependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ private function make_method_accessible( $obj_or_class, $method ) {
* @covers WP_Plugin_Dependencies::__construct
*/
public function test_construct_should_set_requires_plugins_and_plugin_data_to_empty_arrays() {
$dependencies = new WP_Plugin_Dependencies();
$requires_plugins = $this->make_prop_accessible( $dependencies, 'requires_plugins' );
$plugin_data = $this->make_prop_accessible( $dependencies, 'plugin_data' );
$dependencies = new WP_Plugin_Dependencies();
$requires_plugins = $this->make_prop_accessible( $dependencies, 'requires_plugins' );
$dependency_api_data = $this->make_prop_accessible( $dependencies, 'dependency_api_data' );

$actual_requires_plugins = $requires_plugins->getValue( $dependencies );
$actual_plugin_data = $plugin_data->getValue( $dependencies );
$actual_requires_plugins = $requires_plugins->getValue( $dependencies );
$actual_dependency_api_data = $dependency_api_data->getValue( $dependencies );

$this->assertIsArray( $actual_requires_plugins, '$requires_plugins is not an array.' );
$this->assertEmpty( $actual_requires_plugins, '$requires_plugins is not empty.' );
$this->assertIsArray( $actual_plugin_data, '$plugin_data is not an array.' );
$this->assertEmpty( $actual_plugin_data, '$plugin_data is not empty.' );
$this->assertIsArray( $actual_dependency_api_data, '$dependency_api_data is not an array.' );
$this->assertEmpty( $actual_dependency_api_data, '$dependency_api_data is not empty.' );
}

/**
Expand Down Expand Up @@ -133,7 +133,7 @@ public function test_parse_plugin_headers( $plugins_data, $expected ) {

foreach ( $plugins_data as $name => $data ) {
$plugin_data = array_map(
static function( $value, $header ) {
static function ( $value, $header ) {
return $header . ': ' . $value;
},
$data,
Expand Down Expand Up @@ -164,7 +164,7 @@ static function( $value, $header ) {
$test_plugin = basename( self::$plugins_dir ) . '/' . $plugin_file[0];
$actual = array_filter(
$actual,
function( $key ) use ( $test_plugin ) {
function ( $key ) use ( $test_plugin ) {
return $test_plugin === $key;
},
ARRAY_FILTER_USE_KEY
Expand Down

0 comments on commit 539dad7

Please sign in to comment.