PHP code example of seec / phpunit-consecutive-params

1. Go to this page and download the library: Download seec/phpunit-consecutive-params library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

seec / phpunit-consecutive-params example snippets




declare(strict_types=1);

namespace Your\Namespace\For\Tests;

use SEEC\PhpUnit\Helper\ConsecutiveParams;

final class TestRunnerContextTest extends TestCase
{
    use ConsecutiveParams;
    ...

    public function test_it_can_use_consecutive_replacement(): void
    {
        $mock = $this->createMock(\stdClass::class);
        $mock->expects($this->exactly(3))
            ->method('foo')
            ->with(...$this->withConsecutive(
                ['a', 'b'],
                ['c', 'd'],
                ['e', 'f']
            ));
    }
 
->withConsecutive(
    ['a', 'b'],
    ['c', 'd'],
    ['e', 'f']
)