-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix composite validation test for Symfony < 5.1
- Loading branch information
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Overblog\GraphQLBundle\Tests\Functional\App\Validator; | ||
|
||
use Symfony\Component\Validator\AtLeastOneOf as BaseAtLeastOneOf; | ||
use Symfony\Component\Validator\Constraint; | ||
|
||
if (class_exists(BaseAtLeastOneOf::class)) { | ||
class AtLeastOneOf extends BaseAtLeastOneOf | ||
{ | ||
} | ||
} else { | ||
class AtLeastOneOf extends Constraint | ||
{ | ||
public string $message = 'Mock constraint'; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
public $constraints = []; | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
public $includeInternalMessages = true; | ||
|
||
/** | ||
* @return class-string | ||
*/ | ||
public function validatedBy(): string | ||
{ | ||
return MockValidator::class; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters