Skip to content

Commit b9f2cfb

Browse files
committed
test: Migrate ParserTest fixtures to the cucumber gherkin testdata format
1 parent a304216 commit b9f2cfb

117 files changed

Lines changed: 702 additions & 1042 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/Cucumber/CompatibilityTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ class CompatibilityTest extends TestCase
6161
'incomplete_background_2.feature' => 'Background descriptions not supported',
6262
'examples_keyword_in_background_description.feature' => 'Background descriptions not supported',
6363
'extra_blank_lines_everywhere.feature' => 'Background / Examples descriptions not supported',
64+
'addition.feature' => 'Trailing whitespace in description lines is trimmed',
65+
'hashes_in_quotes.feature' => 'Trailing whitespace in description lines is trimmed',
66+
'multiline_name.feature' => 'Multiline titles are folded into the title instead of the description',
67+
'multiline_name_with_newlines.feature' => 'Multiline titles are folded into the title instead of the description',
68+
'issue_13.feature' => 'Multiline titles are folded into the title instead of the description',
69+
'background_title.feature' => 'Multiline titles are folded into the title instead of the description',
70+
'complex_descriptions.feature' => 'Multiline titles are folded into the title instead of the description',
6471
],
6572
'gherkin-32' => [
6673
'complex_background.feature' => 'Rule keyword not supported',
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Behat\Gherkin\Node\FeatureNode:
2+
title: Addition
3+
description: |-
4+
In order to avoid silly mistakes
5+
As a math idiot
6+
I want to be told the sum of two numbers
7+
tags: []
8+
background: ~
9+
scenarios:
10+
-
11+
Behat\Gherkin\Node\ScenarioNode:
12+
title: 'Add two numbers'
13+
tags: []
14+
steps:
15+
-
16+
Behat\Gherkin\Node\StepNode:
17+
keywordType: Given
18+
fullText: 'Given I have entered 11 into the calculator'
19+
keyword: Given
20+
text: 'I have entered 11 into the calculator'
21+
arguments: []
22+
line: 8
23+
-
24+
Behat\Gherkin\Node\StepNode:
25+
keywordType: Given
26+
fullText: 'And I have entered 12 into the calculator'
27+
keyword: And
28+
text: 'I have entered 12 into the calculator'
29+
arguments: []
30+
line: 9
31+
-
32+
Behat\Gherkin\Node\StepNode:
33+
keywordType: When
34+
fullText: 'When I press add'
35+
keyword: When
36+
text: 'I press add'
37+
arguments: []
38+
line: 10
39+
-
40+
Behat\Gherkin\Node\StepNode:
41+
keywordType: Then
42+
fullText: 'Then the result should be 23 on the screen'
43+
keyword: Then
44+
text: 'the result should be 23 on the screen'
45+
arguments: []
46+
line: 11
47+
keyword: Scenario
48+
line: 7
49+
description: ~
50+
-
51+
Behat\Gherkin\Node\ScenarioNode:
52+
title: 'Div two numbers'
53+
tags: []
54+
steps:
55+
-
56+
Behat\Gherkin\Node\StepNode:
57+
keywordType: Given
58+
fullText: 'Given I have entered 10 into the calculator'
59+
keyword: Given
60+
text: 'I have entered 10 into the calculator'
61+
arguments: []
62+
line: 14
63+
-
64+
Behat\Gherkin\Node\StepNode:
65+
keywordType: Given
66+
fullText: 'And I have entered 2 into the calculator'
67+
keyword: And
68+
text: 'I have entered 2 into the calculator'
69+
arguments: []
70+
line: 15
71+
-
72+
Behat\Gherkin\Node\StepNode:
73+
keywordType: When
74+
fullText: 'When I press div'
75+
keyword: When
76+
text: 'I press div'
77+
arguments: []
78+
line: 16
79+
-
80+
Behat\Gherkin\Node\StepNode:
81+
keywordType: Then
82+
fullText: 'Then the result should be 5 on the screen'
83+
keyword: Then
84+
text: 'the result should be 5 on the screen'
85+
arguments: []
86+
line: 17
87+
keyword: Scenario
88+
line: 13
89+
description: ~
90+
keyword: Feature
91+
language: en
92+
file: {BASEDIR}/tests/Cucumber/extra_testdata/good/addition.feature
93+
line: 2
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Behat\Gherkin\Node\FeatureNode:
2+
title: 'Feature with titled background'
3+
description: ~
4+
tags: []
5+
background:
6+
Behat\Gherkin\Node\BackgroundNode:
7+
title: |-
8+
Some Background
9+
title with
10+
couple
11+
of
12+
| continuous |
13+
"""
14+
strings
15+
steps:
16+
-
17+
Behat\Gherkin\Node\StepNode:
18+
keywordType: Given
19+
fullText: 'Given a passing step'
20+
keyword: Given
21+
text: 'a passing step'
22+
arguments: []
23+
line: 10
24+
keyword: Background
25+
line: 3
26+
description: ~
27+
scenarios:
28+
-
29+
Behat\Gherkin\Node\ScenarioNode:
30+
title: ~
31+
tags: []
32+
steps:
33+
-
34+
Behat\Gherkin\Node\StepNode:
35+
keywordType: Given
36+
fullText: 'Given a failing step'
37+
keyword: Given
38+
text: 'a failing step'
39+
arguments: []
40+
line: 13
41+
keyword: Scenario
42+
line: 12
43+
description: ~
44+
keyword: Feature
45+
language: en
46+
file: {BASEDIR}/tests/Cucumber/extra_testdata/good/background_title.feature
47+
line: 1
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Behat\Gherkin\Node\FeatureNode:
2+
title: 'Complex descriptions'
3+
description: |-
4+
Some description with
5+
| table | row|
6+
7+
and
8+
9+
"""
10+
"""
11+
tags: []
12+
background: ~
13+
scenarios:
14+
-
15+
Behat\Gherkin\Node\ScenarioNode:
16+
title: |-
17+
Some
18+
| complex | description |
19+
20+
"""
21+
hell yeah
22+
"""
23+
tags: []
24+
steps:
25+
-
26+
Behat\Gherkin\Node\StepNode:
27+
keywordType: Given
28+
fullText: 'Given one two three'
29+
keyword: Given
30+
text: 'one two three'
31+
arguments: []
32+
line: 22
33+
keyword: Scenario
34+
line: 16
35+
description: ~
36+
keyword: Feature
37+
language: en
38+
file: {BASEDIR}/tests/Cucumber/extra_testdata/good/complex_descriptions.feature
39+
line: 7
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Behat\Gherkin\Node\FeatureNode:
2+
title: "Some '#quoted' string"
3+
description: |-
4+
In order to avoid silly mistakes
5+
As a "#math" idiot
6+
I want to be told the sum of two numbers
7+
tags: []
8+
background: ~
9+
scenarios:
10+
-
11+
Behat\Gherkin\Node\ScenarioNode:
12+
title: 'Add two numbers'
13+
tags: []
14+
steps:
15+
-
16+
Behat\Gherkin\Node\StepNode:
17+
keywordType: Given
18+
fullText: 'Given I have entered 11 into the calculator'
19+
keyword: Given
20+
text: 'I have entered 11 into the calculator'
21+
arguments: []
22+
line: 8
23+
-
24+
Behat\Gherkin\Node\StepNode:
25+
keywordType: Given
26+
fullText: 'And I have entered 12 into the calculator'
27+
keyword: And
28+
text: 'I have entered 12 into the calculator'
29+
arguments: []
30+
line: 9
31+
-
32+
Behat\Gherkin\Node\StepNode:
33+
keywordType: When
34+
fullText: 'When I press "#add"'
35+
keyword: When
36+
text: 'I press "#add"'
37+
arguments: []
38+
line: 10
39+
-
40+
Behat\Gherkin\Node\StepNode:
41+
keywordType: Then
42+
fullText: 'Then the result should be 23 on the screen'
43+
keyword: Then
44+
text: 'the result should be 23 on the screen'
45+
arguments: []
46+
line: 11
47+
keyword: Scenario
48+
line: 7
49+
description: ~
50+
-
51+
Behat\Gherkin\Node\ScenarioNode:
52+
title: 'Div "#two" numbers # as'
53+
tags: []
54+
steps:
55+
-
56+
Behat\Gherkin\Node\StepNode:
57+
keywordType: Given
58+
fullText: 'Given I have entered 10 into the calculator'
59+
keyword: Given
60+
text: 'I have entered 10 into the calculator'
61+
arguments: []
62+
line: 14
63+
-
64+
Behat\Gherkin\Node\StepNode:
65+
keywordType: Given
66+
fullText: 'And I have entered # 2 into the calculator'
67+
keyword: And
68+
text: 'I have entered # 2 into the calculator'
69+
arguments: []
70+
line: 15
71+
-
72+
Behat\Gherkin\Node\StepNode:
73+
keywordType: When
74+
fullText: 'When I press div'
75+
keyword: When
76+
text: 'I press div'
77+
arguments: []
78+
line: 16
79+
-
80+
Behat\Gherkin\Node\StepNode:
81+
keywordType: Then
82+
fullText: 'Then the result should be 5 on the screen'
83+
keyword: Then
84+
text: 'the result should be 5 on the screen'
85+
arguments: []
86+
line: 17
87+
keyword: Scenario
88+
line: 13
89+
description: ~
90+
keyword: Feature
91+
language: en
92+
file: {BASEDIR}/tests/Cucumber/extra_testdata/good/hashes_in_quotes.feature
93+
line: 2
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
Behat\Gherkin\Node\FeatureNode:
2+
title: 'test pystring'
3+
description: 'second line'
4+
tags: []
5+
background: ~
6+
scenarios:
7+
-
8+
Behat\Gherkin\Node\ScenarioNode:
9+
title: |-
10+
testing py string in scenario
11+
second line
12+
tags: []
13+
steps:
14+
-
15+
Behat\Gherkin\Node\StepNode:
16+
keywordType: Given
17+
fullText: 'Given the pystring is'
18+
keyword: Given
19+
text: 'the pystring is'
20+
arguments:
21+
-
22+
Behat\Gherkin\Node\PyStringNode:
23+
strings:
24+
- 'Test store name'
25+
- 'Denmark, Kolding'
26+
- '6000'
27+
line: 8
28+
line: 7
29+
keyword: Scenario
30+
line: 4
31+
description: ~
32+
-
33+
Behat\Gherkin\Node\OutlineNode:
34+
tables:
35+
-
36+
Behat\Gherkin\Node\ExampleTableNode:
37+
keyword: Examples
38+
tags: []
39+
name: ~
40+
description: ~
41+
maxLineLength:
42+
- 0
43+
table:
44+
24:
45+
- ''
46+
examples: '**NOT INITIALIZED**'
47+
title: |-
48+
testing py string in scenario outline
49+
second line
50+
tags: []
51+
steps:
52+
-
53+
Behat\Gherkin\Node\StepNode:
54+
keywordType: Given
55+
fullText: 'Given the pystring is'
56+
keyword: Given
57+
text: 'the pystring is'
58+
arguments:
59+
-
60+
Behat\Gherkin\Node\PyStringNode:
61+
strings:
62+
- 'Test store name'
63+
- 'Denmark, Kolding'
64+
- '6000'
65+
line: 18
66+
line: 17
67+
keyword: 'Scenario Outline'
68+
line: 14
69+
description: ~
70+
keyword: Feature
71+
language: en
72+
file: {BASEDIR}/tests/Cucumber/extra_testdata/good/issue_13.feature
73+
line: 1

0 commit comments

Comments
 (0)