188 lines
5.9 KiB
YAML
188 lines
5.9 KiB
YAML
|
name: ImageValidatorTest
|
||
|
class_comment: '# * @requires extension fileinfo
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @extends ConstraintValidatorTestCase<ImageValidator>'
|
||
|
dependencies:
|
||
|
- name: Image
|
||
|
type: class
|
||
|
source: Symfony\Component\Validator\Constraints\Image
|
||
|
- name: ImageValidator
|
||
|
type: class
|
||
|
source: Symfony\Component\Validator\Constraints\ImageValidator
|
||
|
- name: ConstraintValidatorTestCase
|
||
|
type: class
|
||
|
source: Symfony\Component\Validator\Test\ConstraintValidatorTestCase
|
||
|
properties: []
|
||
|
methods:
|
||
|
- name: testFileNotFound
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: constraint
|
||
|
comment: "# * @requires extension fileinfo\n# *\n# * @extends ConstraintValidatorTestCase<ImageValidator>\n\
|
||
|
# */\n# class ImageValidatorTest extends ConstraintValidatorTestCase\n# {\n# protected\
|
||
|
\ string $path;\n# protected string $image;\n# protected string $imageLandscape;\n\
|
||
|
# protected string $imagePortrait;\n# protected string $image4By3;\n# protected\
|
||
|
\ string $image16By9;\n# protected string $imageCorrupted;\n# protected string\
|
||
|
\ $notAnImage;\n# \n# protected function createValidator(): ImageValidator\n#\
|
||
|
\ {\n# return new ImageValidator();\n# }\n# \n# protected function setUp(): void\n\
|
||
|
# {\n# parent::setUp();\n# \n# $this->image = __DIR__.'/Fixtures/test.gif';\n\
|
||
|
# $this->imageLandscape = __DIR__.'/Fixtures/test_landscape.gif';\n# $this->imagePortrait\
|
||
|
\ = __DIR__.'/Fixtures/test_portrait.gif';\n# $this->image4By3 = __DIR__.'/Fixtures/test_4by3.gif';\n\
|
||
|
# $this->image16By9 = __DIR__.'/Fixtures/test_16by9.gif';\n# $this->imageCorrupted\
|
||
|
\ = __DIR__.'/Fixtures/test_corrupted.gif';\n# $this->notAnImage = __DIR__.'/Fixtures/ccc.txt';\n\
|
||
|
# }\n# \n# public function testNullIsValid()\n# {\n# $this->validator->validate(null,\
|
||
|
\ new Image());\n# \n# $this->assertNoViolation();\n# }\n# \n# public function\
|
||
|
\ testEmptyStringIsValid()\n# {\n# $this->validator->validate('', new Image());\n\
|
||
|
# \n# $this->assertNoViolation();\n# }\n# \n# public function testValidImage()\n\
|
||
|
# {\n# $this->validator->validate($this->image, new Image());\n# \n# $this->assertNoViolation();\n\
|
||
|
# }\n# \n# /**\n# * Checks that the logic from FileValidator still works.\n# *\n\
|
||
|
# * @dataProvider provideConstraintsWithNotFoundMessage"
|
||
|
- name: provideConstraintsWithNotFoundMessage
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testValidSize
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testWidthTooSmall
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: constraint
|
||
|
comment: '# * @dataProvider provideMinWidthConstraints'
|
||
|
- name: provideMinWidthConstraints
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testWidthTooBig
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: constraint
|
||
|
comment: '# * @dataProvider provideMaxWidthConstraints'
|
||
|
- name: provideMaxWidthConstraints
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testHeightTooSmall
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: constraint
|
||
|
comment: '# * @dataProvider provideMinHeightConstraints'
|
||
|
- name: provideMinHeightConstraints
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testHeightTooBig
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: constraint
|
||
|
comment: '# * @dataProvider provideMaxHeightConstraints'
|
||
|
- name: provideMaxHeightConstraints
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testPixelsTooFew
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: constraint
|
||
|
comment: '# * @dataProvider provideMinPixelsConstraints'
|
||
|
- name: provideMinPixelsConstraints
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testPixelsTooMany
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: constraint
|
||
|
comment: '# * @dataProvider provideMaxPixelsConstraints'
|
||
|
- name: provideMaxPixelsConstraints
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testRatioTooSmall
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: constraint
|
||
|
comment: '# * @dataProvider provideMinRatioConstraints'
|
||
|
- name: provideMinRatioConstraints
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testRatioTooBig
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: constraint
|
||
|
comment: '# * @dataProvider provideMaxRatioConstraints'
|
||
|
- name: provideMaxRatioConstraints
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testMaxRatioUsesTwoDecimalsOnly
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testMinRatioUsesInputMoreDecimals
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testMaxRatioUsesInputMoreDecimals
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testSquareNotAllowed
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: constraint
|
||
|
comment: '# * @dataProvider provideAllowSquareConstraints'
|
||
|
- name: provideAllowSquareConstraints
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testLandscapeNotAllowed
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: constraint
|
||
|
comment: '# * @dataProvider provideAllowLandscapeConstraints'
|
||
|
- name: provideAllowLandscapeConstraints
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testPortraitNotAllowed
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: constraint
|
||
|
comment: '# * @dataProvider provideAllowPortraitConstraints'
|
||
|
- name: provideAllowPortraitConstraints
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testCorrupted
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: constraint
|
||
|
comment: '# * @dataProvider provideDetectCorruptedConstraints'
|
||
|
- name: testInvalidMimeType
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: provideDetectCorruptedConstraints
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
- name: testInvalidMimeTypeWithNarrowedSet
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: constraint
|
||
|
comment: '# * @dataProvider provideInvalidMimeTypeWithNarrowedSet'
|
||
|
- name: provideInvalidMimeTypeWithNarrowedSet
|
||
|
visibility: public
|
||
|
parameters: []
|
||
|
comment: null
|
||
|
traits:
|
||
|
- Symfony\Component\Validator\Constraints\Image
|
||
|
- Symfony\Component\Validator\Constraints\ImageValidator
|
||
|
- Symfony\Component\Validator\Test\ConstraintValidatorTestCase
|
||
|
interfaces: []
|