228 lines
6.9 KiB
YAML
228 lines
6.9 KiB
YAML
name: AbstractRequestHandlerTestCase
|
|
class_comment: null
|
|
dependencies:
|
|
- name: TestCase
|
|
type: class
|
|
source: PHPUnit\Framework\TestCase
|
|
- name: EventDispatcher
|
|
type: class
|
|
source: Symfony\Component\EventDispatcher\EventDispatcher
|
|
- name: DataMapper
|
|
type: class
|
|
source: Symfony\Component\Form\Extension\Core\DataMapper\DataMapper
|
|
- name: CollectionType
|
|
type: class
|
|
source: Symfony\Component\Form\Extension\Core\Type\CollectionType
|
|
- name: TextType
|
|
type: class
|
|
source: Symfony\Component\Form\Extension\Core\Type\TextType
|
|
- name: Form
|
|
type: class
|
|
source: Symfony\Component\Form\Form
|
|
- name: FormBuilder
|
|
type: class
|
|
source: Symfony\Component\Form\FormBuilder
|
|
- name: FormError
|
|
type: class
|
|
source: Symfony\Component\Form\FormError
|
|
- name: FormFactory
|
|
type: class
|
|
source: Symfony\Component\Form\FormFactory
|
|
- name: FormRegistry
|
|
type: class
|
|
source: Symfony\Component\Form\FormRegistry
|
|
- name: Forms
|
|
type: class
|
|
source: Symfony\Component\Form\Forms
|
|
- name: RequestHandlerInterface
|
|
type: class
|
|
source: Symfony\Component\Form\RequestHandlerInterface
|
|
- name: ResolvedFormTypeFactory
|
|
type: class
|
|
source: Symfony\Component\Form\ResolvedFormTypeFactory
|
|
- name: ItemFileType
|
|
type: class
|
|
source: Symfony\Component\Form\Tests\Extension\Type\ItemFileType
|
|
- name: ServerParams
|
|
type: class
|
|
source: Symfony\Component\Form\Util\ServerParams
|
|
properties: []
|
|
methods:
|
|
- name: testSubmitIfNameInRequest
|
|
visibility: public
|
|
parameters:
|
|
- name: method
|
|
comment: "# * @author Bernhard Schussek <bschussek@gmail.com>\n# */\n# abstract\
|
|
\ class AbstractRequestHandlerTestCase extends TestCase\n# {\n# protected RequestHandlerInterface\
|
|
\ $requestHandler;\n# protected FormFactory $factory;\n# protected mixed $request\
|
|
\ = null;\n# protected ServerParams $serverParams;\n# \n# protected function setUp():\
|
|
\ void\n# {\n# $this->serverParams = new class extends ServerParams {\n# public\
|
|
\ ?int $contentLength = null;\n# public string $postMaxSize = '';\n# \n# public\
|
|
\ function getContentLength(): ?int\n# {\n# return $this->contentLength;\n# }\n\
|
|
# \n# public function getNormalizedIniPostMaxSize(): string\n# {\n# return $this->postMaxSize;\n\
|
|
# }\n# };\n# \n# $this->requestHandler = $this->getRequestHandler();\n# $this->factory\
|
|
\ = Forms::createFormFactoryBuilder()->getFormFactory();\n# $this->request = null;\n\
|
|
# }\n# \n# public static function methodExceptGetProvider(): array\n# {\n# return\
|
|
\ [\n# ['POST'],\n# ['PUT'],\n# ['DELETE'],\n# ['PATCH'],\n# ];\n# }\n# \n# public\
|
|
\ static function methodProvider(): array\n# {\n# return array_merge([\n# ['GET'],\n\
|
|
# ], self::methodExceptGetProvider());\n# }\n# \n# /**\n# * @dataProvider methodProvider"
|
|
- name: testDoNotSubmitIfWrongRequestMethod
|
|
visibility: public
|
|
parameters:
|
|
- name: method
|
|
comment: '# * @dataProvider methodProvider'
|
|
- name: testDoNoSubmitSimpleFormIfNameNotInRequestAndNotGetRequest
|
|
visibility: public
|
|
parameters:
|
|
- name: method
|
|
comment: '# * @dataProvider methodExceptGetProvider'
|
|
- name: testDoNotSubmitCompoundFormIfNameNotInRequestAndNotGetRequest
|
|
visibility: public
|
|
parameters:
|
|
- name: method
|
|
comment: '# * @dataProvider methodExceptGetProvider'
|
|
- name: testDoNotSubmitIfNameNotInRequestAndGetRequest
|
|
visibility: public
|
|
parameters: []
|
|
comment: null
|
|
- name: testSubmitFormWithEmptyNameIfAtLeastOneFieldInRequest
|
|
visibility: public
|
|
parameters:
|
|
- name: method
|
|
comment: '# * @dataProvider methodProvider'
|
|
- name: testDoNotSubmitFormWithEmptyNameIfNoFieldInRequest
|
|
visibility: public
|
|
parameters:
|
|
- name: method
|
|
comment: '# * @dataProvider methodProvider'
|
|
- name: testMergeParamsAndFiles
|
|
visibility: public
|
|
parameters:
|
|
- name: method
|
|
comment: '# * @dataProvider methodExceptGetProvider'
|
|
- name: testIntegerChildren
|
|
visibility: public
|
|
parameters: []
|
|
comment: null
|
|
- name: testMergeParamsAndFilesMultiple
|
|
visibility: public
|
|
parameters:
|
|
- name: method
|
|
comment: '# * @dataProvider methodExceptGetProvider'
|
|
- name: testParamTakesPrecedenceOverFile
|
|
visibility: public
|
|
parameters:
|
|
- name: method
|
|
comment: '# * @dataProvider methodExceptGetProvider'
|
|
- name: testMergeZeroIndexedCollection
|
|
visibility: public
|
|
parameters: []
|
|
comment: null
|
|
- name: testSubmitFileIfNoParam
|
|
visibility: public
|
|
parameters:
|
|
- name: method
|
|
comment: '# * @dataProvider methodExceptGetProvider'
|
|
- name: testSubmitMultipleFiles
|
|
visibility: public
|
|
parameters:
|
|
- name: method
|
|
comment: '# * @dataProvider methodExceptGetProvider'
|
|
- name: testSubmitFileWithNamelessForm
|
|
visibility: public
|
|
parameters:
|
|
- name: method
|
|
comment: '# * @dataProvider methodExceptGetProvider'
|
|
- name: testAddFormErrorIfPostMaxSizeExceeded
|
|
visibility: public
|
|
parameters:
|
|
- name: contentLength
|
|
- name: iniMax
|
|
- name: shouldFail
|
|
- name: errorParams
|
|
default: '[]'
|
|
comment: '# * @dataProvider getPostMaxSizeFixtures'
|
|
- name: getPostMaxSizeFixtures
|
|
visibility: public
|
|
parameters: []
|
|
comment: null
|
|
- name: testUploadedFilesAreAccepted
|
|
visibility: public
|
|
parameters: []
|
|
comment: null
|
|
- name: testInvalidFilesAreRejected
|
|
visibility: public
|
|
parameters: []
|
|
comment: null
|
|
- name: testFailedFileUploadIsTurnedIntoFormError
|
|
visibility: public
|
|
parameters:
|
|
- name: errorCode
|
|
- name: expectedErrorCode
|
|
comment: '# * @dataProvider uploadFileErrorCodes'
|
|
- name: uploadFileErrorCodes
|
|
visibility: public
|
|
parameters: []
|
|
comment: null
|
|
- name: setRequestData
|
|
visibility: protected
|
|
parameters:
|
|
- name: method
|
|
- name: data
|
|
- name: files
|
|
default: '[]'
|
|
comment: null
|
|
- name: getRequestHandler
|
|
visibility: protected
|
|
parameters: []
|
|
comment: null
|
|
- name: getUploadedFile
|
|
visibility: protected
|
|
parameters:
|
|
- name: suffix
|
|
default: ''''''
|
|
comment: null
|
|
- name: getInvalidFile
|
|
visibility: protected
|
|
parameters: []
|
|
comment: null
|
|
- name: getFailedUploadedFile
|
|
visibility: protected
|
|
parameters:
|
|
- name: errorCode
|
|
comment: null
|
|
- name: createForm
|
|
visibility: protected
|
|
parameters:
|
|
- name: name
|
|
- name: method
|
|
default: 'null'
|
|
- name: compound
|
|
default: 'false'
|
|
comment: null
|
|
- name: createBuilder
|
|
visibility: protected
|
|
parameters:
|
|
- name: name
|
|
- name: compound
|
|
default: 'false'
|
|
- name: options
|
|
default: '[]'
|
|
comment: null
|
|
traits:
|
|
- PHPUnit\Framework\TestCase
|
|
- Symfony\Component\EventDispatcher\EventDispatcher
|
|
- Symfony\Component\Form\Extension\Core\DataMapper\DataMapper
|
|
- Symfony\Component\Form\Extension\Core\Type\CollectionType
|
|
- Symfony\Component\Form\Extension\Core\Type\TextType
|
|
- Symfony\Component\Form\Form
|
|
- Symfony\Component\Form\FormBuilder
|
|
- Symfony\Component\Form\FormError
|
|
- Symfony\Component\Form\FormFactory
|
|
- Symfony\Component\Form\FormRegistry
|
|
- Symfony\Component\Form\Forms
|
|
- Symfony\Component\Form\RequestHandlerInterface
|
|
- Symfony\Component\Form\ResolvedFormTypeFactory
|
|
- Symfony\Component\Form\Tests\Extension\Type\ItemFileType
|
|
- Symfony\Component\Form\Util\ServerParams
|
|
interfaces: []
|