Automattic\WP\Cron_Control\Tests\Utils::compare_arrays PHP Method

compare_arrays() static public method

Check that two arrays are equal
static public compare_arrays ( $expected, $test, $context )
    static function compare_arrays($expected, $test, $context)
    {
        $tested_data = array();
        foreach ($expected as $key => $value) {
            if (isset($test[$key])) {
                $tested_data[$key] = $test[$key];
            } else {
                $tested_data[$key] = null;
            }
        }
        if (is_object($context)) {
            $context->assertEquals($expected, $tested_data);
        } else {
            return $tested_data;
        }
    }