From ffb4240b369b11316e544064c34b23f9838e49ec Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 24 Feb 2023 09:11:42 +0100 Subject: [PATCH] Readd an integration test --- tests/IntegrationTest.php | 6 - tests/fixtures/expected/main/datetime.html | 689 +++++++++++++-------- 2 files changed, 425 insertions(+), 270 deletions(-) diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php index 3be62d5d..ef7c8b3e 100644 --- a/tests/IntegrationTest.php +++ b/tests/IntegrationTest.php @@ -40,12 +40,6 @@ public function testIntegration(string $folder) $actualFilename = $buildConfig->getOutputDir().'/'.$relativePath; $this->assertFileExists($actualFilename); -if(str_contains($expectedFile, 'datetime.html')) { - $this->markTestSkipped('Temporarily disabled becuase I cannot make it work'); - - return; -} - $this->assertSame( // removes odd trailing space the indenter is adding str_replace(" \n", "\n", $indenter->indent($expectedFile->getContents())), diff --git a/tests/fixtures/expected/main/datetime.html b/tests/fixtures/expected/main/datetime.html index 1e701b03..c75b859e 100644 --- a/tests/fixtures/expected/main/datetime.html +++ b/tests/fixtures/expected/main/datetime.html @@ -1,224 +1,328 @@ - - - - - - - -
-

DateTimeType Field

-

This field type allows the user to modify data that represents a specific + + + + +

+

+ DateTimeType Field +

+

This field type allows the user to modify data that represents a specific date and time (e.g. 1984-06-05 12:15:30).

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Underlying Data Typecan be DateTime, string, timestamp, or array (see the input option)
Rendered assingle text box or three select fields
Options -
Overridden options -
Parent typeFormType
ClassDateTimeType
RefSome Test Docs! +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + -
Underlying Data Typecan be DateTime, string, timestamp, or array (see the input option)
Rendered assingle text box or three select fields
Options + +
Overridden options + +
Parent typeFormType
ClassDateTimeType
RefSome Test Docs! Test reference
-
-

Field Options

-
-

The date_format Option

-

type: integer or string default: IntlDateFormatter::MEDIUM

-

Defines the format option that will be passed down to the date field. +

+
+
+

+ Field Options +

+
+

+ The date_format Option +

+

type: integer or string default: IntlDateFormatter::MEDIUM

+

Defines the format option that will be passed down to the date field. for more details.

-
-

- - Tip -

This is a little tip about something! We an also talk about specific +

+

+ + + + Tip +

+

This is a little tip about something! We an also talk about specific methods: doRequest(). -Or a namespace: Constraints. +Or a namespace: Constraints. Or a PHP function: parse_ini_file. Or a PHP method! Locale::getDefault().

-
-
-
-

date_widget

-

Date widget!

-
-

- - Note -

Sometimes we add notes. But not too often because they interrupt the flow. +

+
+
+

+ date_widget +

+

Date widget!

+
+

+ + + + Note +

+

Sometimes we add notes. But not too often because they interrupt the flow. FormType Documentation

-
-

This is included documentation about the date_widget option.

-
-
-

placeholder

-
-

- - - -New in version 2.6

-

The placeholder option was introduced in Symfony 2.6 and replaces +

+

This is included documentation about the date_widget option.

+
+
+

+ placeholder +

+
+

+ 2.6 +

+

The placeholder option was introduced in Symfony 2.6 and replaces empty_value, which is available prior to 2.6. -FormType Documentation

-

type: string | array

-

If your widget option is set to choice, then this field will be represented +FormType Documentation

+
+

type: string | array

+

If your widget option is set to choice, then this field will be represented as a series of select boxes. When the placeholder value is a string, it will be used as the blank value of all select boxes:

-
-
-
1
+            
+
+
1
 2
 3
 4
 5
-
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
-
-$builder->add('startDateTime', DateTimeType::class, array(
-    'placeholder' => 'Select a value',
-));
-
-
-
-

- - - - See also -

Also check out the homepage - Some Test Docs!. +

+                                        
+                                            use
+                                            Symfony
+                                            \
+                                            Component
+                                            \
+                                            Form
+                                            \
+                                            Extension
+                                            \
+                                            Core
+                                            \
+                                            Type
+                                            \
+                                            DateTimeType
+                                            ;
+                                            
+                                                $
+                                                builder
+                                            
+                                            ->
+                                            add(
+                                            'startDateTime'
+                                            , DateTimeType
+                                            ::
+                                            class,
+                                            array
+                                            (
+                                            'placeholder'
+                                            =>
+                                            'Select a value'
+                                            ,
+));
+                                        
+                                    
+
+
+
+

+ + + + See also +

+

Also check out the homepage - Some Test Docs!. FormType Documentation

-
-

Custom classes for links are also cool:

- - -
-
-

format

-

type: string default: Symfony\Component\Form\Extension\Core\Type\DateTimeType::HTML5_FORMAT

-

If the widget option is set to single_text, this option specifies +

+

Custom classes for links are also cool:

+ +
+
+

+ format +

+

+ type: string default: + + Symfony + + \Component + + \Form + + \Extension + + \Core + + \Type + + \DateTimeType::HTML5_FORMAT + +

+

If the widget option is set to single_text, this option specifies the format of the input, i.e. how Symfony will interpret the given input as a datetime string. See Date/Time Format Syntax.

-

But do they really? They also get in the way!

-
-
-

- - Caution -

Using too many sidebars or caution directives can be distracting!

-
-
-

- Best Practice -

Use the bcrypt encoder for hashing your users' passwords.

-
-
-
-

time_widget

-

type: string default: choice

-

Defines the widget option for the TimeType.

-
-
-

widget

-

type: string default: null

-

Defines the widget option for both the DateType. +

+
+ +

But do they really? They also get in the way!

+
+
+
+

+ + + + Caution +

+

Using too many sidebars or caution directives can be distracting!

+
+
+

+ Best Practice +

+

Use the bcrypt encoder for hashing your users' passwords.

+
+
+
+

+ time_widget +

+

type: string default: choice

+

Defines the widget option for the TimeType.

+
+
+

+ widget +

+

type: string default: null

+

Defines the widget option for both the DateType. and TimeType. This can be overridden with the date_widget and time_widget options.

-
-
-
-
-

Overridden Options

-
-

by_reference

-

default: false

-

The DateTime classes are treated as immutable objects.

-
-
-

error_bubbling

-

default: false

-

We also support code blocks!

-
-
-
1
+        
+
+
+

+ Overridden Options +

+
+

+ by_reference +

+

default: false

+

The DateTime classes are treated as immutable objects.

+
+
+

+ error_bubbling +

+

default: false

+

We also support code blocks!

+
+
+
1
 2
 3
-
# app/config/parameters.yml
-parameters:
-    database_driver:   pdo_mysql
-
-
-
-

And configuration blocks:

-
-
    -
  • YAML
  • -
  • XML
  • -
  • PHP
  • -
-
-
-
-
1
+                    
+                                                                        
+                                                                            # app/config/parameters.yml
+                                                                            parameters:
+                                                                            database_driver:
+                                                                            pdo_mysql
+                                                                        
+                                                                    
+
+
+

And configuration blocks:

+
+
+ + + +
+
+
+
+
1
 2
 3
 4
 5
 6
 7
-
# app/config/config.yml
-framework:
-    secret:          '%secret%'
-    router:          { resource: '%kernel.root_dir%/config/routing.yml' }
-    # ...
-
-# ...
-
-
-
-
- + - + +
+
+
-
-
-
-

Field Variables

- - - - - - - - - - - - - - - - - - - + +
VariableTypeUsage
widgetmixedThe value of the widget option
typestringMultiple lines of text here, to show +
+

+ Field Variables +

+
+ + + + + + + + + + + + + + + + + + - - -
VariableTypeUsage
widgetmixedThe value of the widget option
typestringMultiple lines of text here, to show that off
-
-
-

Url checker errors

-

This is a 404 error. +

+
+ +
+

+ Url checker errors +

+

This is a 404 error. And here is an invalid url invalid-url.

+
- - +