Extending body classes in front- and backend

Your snippet adds the following classes to the body tag on the front end,

someText
someText

Your snippet adds the following classes to the body tag on the back end,

someClassA
someClassB

If that is you intended result, then yes that works and is correct.

You could also do,

function add_custom_body_classes($classes) {

    $someClassA = 'someText';
    $someClassB = 'someText';

    if (is_array($classes)) {
        $classes[] = $someClassA;
        $classes[] = $someClassB;
    }
    elseif (is_admin()) {
        $classes .= ' ' . someClassA;
        $classes .= ' ' . someClassB;
    }
    return $classes;
}

add_filter('body_class','add_custom_body_classes');
add_filter('admin_body_class', 'add_custom_body_classes');

By using is_admin conditional statement to make sure you are on the admin page before adding specific classes.

If none of the above is correct, and you want the same classes (someText) to appear on both front and back end, then you need to modify…

$classes .= ' ' . someClassA;
$classes .= ' ' . someClassB;

To show,

$classes .= ' ' . $someClassA;
$classes .= ' ' . $someClassB;

As you were missing $ in your variable names.

Assuming you want the same classes on front and back ends you can also do an array to string conversion like,

function add_custom_body_classes($classes) {

$classes = array('classA', 'classB', 'classC');
$string  = implode($classes, ' ');

    if (!is_admin() && is_array($classes)) {
        return $classes;
    }
    elseif (is_admin()) {
        return $string;
    }
}

add_filter('body_class','add_custom_body_classes');
add_filter('admin_body_class', 'add_custom_body_classes');