Skip to content

Commit 03a0e9d

Browse files
Merge pull request #64 from matthiasnoback/fix_demo
Fix the demo
2 parents 6529c0e + baab09a commit 03a0e9d

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"symfony/security-csrf": "~5.0 || ~6.0",
3939
"phpunit/phpunit": "^9.5",
4040
"symplify/easy-coding-standard": "^9.4",
41-
"symplify/coding-standard": "^9.4"
41+
"symplify/coding-standard": "^9.4",
42+
"symfony/intl": "^5"
4243
}
4344
}

features/interactive.feature

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,34 @@ Feature: It is possible to interactively fill in a form from the CLI
379379
)
380380
"""
381381

382+
Scenario: The demo form
383+
When I run the command "form:demo" and I provide as input
384+
| Input |
385+
| Menno |
386+
| y |
387+
| Main street |
388+
| n |
389+
| test@example.com |
390+
| NL |
391+
| 2001-04-01 |
392+
And the output should contain
393+
"""
394+
Array
395+
(
396+
[name] => Menno
397+
[email] => [email protected]
398+
[country] => NL
399+
[addresses] => Array
400+
(
401+
[0] => Matthias\SymfonyConsoleForm\Tests\Form\Data\Address Object
402+
(
403+
[street] => Main street
404+
)
405+
)
406+
[dateOfBirth] => 2001-04-01T00:00:00+0000
407+
)
408+
"""
409+
382410
Scenario: Non-compound form type in interactive mode
383411
When I run the command "form:non_compound_color" and I provide as input "blue" with parameters
384412
| Parameter | Value |
@@ -418,4 +446,4 @@ Feature: It is possible to interactively fill in a form from the CLI
418446
[value] => Rue du Faubourg Saint-Honoré
419447
)
420448
)
421-
"""
449+
"""

test/Form/Data/Address.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Address
99
/**
1010
* @param $street
1111
*/
12-
public function __construct($street)
12+
public function __construct(?string $street = null)
1313
{
1414
$this->street = $street;
1515
}

0 commit comments

Comments
 (0)