Mocking static methods

Code
<?php

use Laminas\Stdlib\ArrayUtils;
use PHPUnit\Framework\TestCase;

/**
 * This class replaces the original ArrayUtils
 */
class StaticStub
{
    public static function merge(array $array1, array $array2)
    {
        return [];
    }
}

/**
 * The class to test
 */
class Foo
{
    public function mergeAndFoo($array1, $array2)
    {
        $merged = ArrayUtils::merge($array1, $array2);
        $merged[] = 'foo';
        
        return $merged;
    }
}

class StaticTest extends TestCase
{
    public function testMergeAndFoo() : void
    {
        // ArrayUtils is "replaced" by StaticStub
        // This works only with classes from an autoloader
        class_alias('StaticStub', 'Laminas\Stdlib\ArrayUtils');
        
        $array1 = ['bar', 'baz'];
        $array2 = [100, 200];
        
        $foo = new Foo();
        $actual = $foo->mergeAndFoo($array1, $array2);
        
        $this->assertEquals(['foo'], $actual);
    }
}
Result
Time: 00:00.004, Memory: 18.00 MB

OK (1 test, 0 assertions)
Used Versions
PHP 8.3, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8