PHP code example of feature-ninja / testing-matrix
1. Go to this page and download the library: Download feature-ninja/testing-matrix 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/ */
use FeatureNinja\TestingMatrix\Matrix;
use PHPUnit\Framework\Attributes\DataProvider;use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
final class ExampleTest extends TestCase
{
public static function example_data_provider(): Generator
{
yield from Matrix::create([
'a' => [1, 2],
'b' => [3, 4],
]);
}
#[Test]
#[DataProvider('examples')]
public function example(int $a, int $b): void
{
// ...
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.