-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from ingenerator/test-validation-annotations
Ensure validation annotations are being read and validated
- Loading branch information
Showing
5 changed files
with
45 additions
and
7 deletions.
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
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
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
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
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,25 @@ | ||
<?php | ||
/** | ||
* @author Craig Gosman <[email protected]> | ||
* @licence proprietary | ||
*/ | ||
|
||
namespace integration; | ||
|
||
use Ingenerator\KohanaExtras\DependencyFactory\SymfonyValidationFactory; | ||
use Ingenerator\Warden\Core\Interactor\UserRegistrationRequest; | ||
use Ingenerator\Warden\Validator\Symfony\SymfonyValidator; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class SymfonyValidatorAnnotationTest extends TestCase | ||
{ | ||
public function test_symfony_validator_is_configured_to_read_doctrine_annotations(): void | ||
{ | ||
$warden_validator = new SymfonyValidator(SymfonyValidationFactory::buildValidator()); | ||
$registration_req = UserRegistrationRequest::fromArray(['email' => '', 'password' => '12345678']); | ||
$this->assertSame( | ||
['email' => 'This value should not be blank.'], | ||
$warden_validator->validate($registration_req) | ||
); | ||
} | ||
} |