Returning different values in a specific order from your mocked method in PHPUnit

Code
<?php

use PHPUnit\Framework\TestCase;

class 
ConsecutiveTest extends TestCase
{
    public function 
testCounterCall() : void
    
{
        
$counter $this->createMock(Counter::CLASS);
        
$counter->expects($this->atLeastOnce())
            ->
method('increment')
            ->
willReturnOnConsecutiveCalls(123);
        
        
$this->assertEquals(1$counter->increment());
        
$this->assertEquals(2$counter->increment());
        
$this->assertEquals(3$counter->increment());
        
// Any further invocation returns null
        
$this->assertEquals(null$counter->increment());
    }
}

class 
Counter
{
    private 
$count 0;
    
    public function 
increment()
    {
        return ++
$this->count;
    }
}
Result
Time: 00:00.006, Memory: 4.00 MB

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