PHP code example of skrepr / dto-tester
1. Go to this page and download the library: Download skrepr/dto-tester 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/ */
skrepr / dto-tester example snippets
protected function getTestValuesForMethod(string $methodName, string $parameterName, string $parameterType): ?array
{
return match ($parameterType) {
'int' => [1, 42, 1337],
'string' => ['test', 'skrper'],
'bool' => [true, false],
SomeClass::class => [new SomeClass(), $this->createMock(SomeClass::class)]
};
}