symfony_example_app/tests/Validator/ValidatorTestCase.php
Ondrej Vlach 1437ce4558
feat: add CurrencyValidator
fix: add CurrencyValidator

CurrencyValidator

zarad
2024-01-17 19:11:44 +01:00

20 lines
532 B
PHP

<?php
namespace App\Tests\Validator;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
abstract class ValidatorTestCase extends TestCase
{
protected function createExecutionContext(bool $violation): ExecutionContextInterface {
$expected = $violation ? $this->once() : $this->never();
$context = $this->createMock(ExecutionContextInterface::class);
$context->expects($expected)
->method('buildViolation');
return $context;
}
}