PHP code example of raptor / test-utils
1. Go to this page and download the library: Download raptor/test-utils 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/ */
raptor / test-utils example snippets
use Raptor\Test\TestDataContainer\TestDataContainer;
class someTests extends TestCase
{
use WithDataLoaderTrait;
...
/**
* @dataProvider someDataProvider
*/
public function testSomething(TestDataContainer $dataContainer): void
{
/** @var \SomeTestsDataContainer $dataContainer */
$value = $dataContainer->getValue();
...
}
public function someDataProvider(): array
{
return $this->loadFromFile('some_tests.json');
}
...
}
bash
php vendor/raptor/test-utils/generate-ide-test-containers path