5
5
namespace Php \PieBehaviourTest ;
6
6
7
7
use Behat \Behat \Context \Context ;
8
+ use Behat \Step \Then ;
9
+ use Behat \Step \When ;
8
10
use Composer \Util \Platform ;
9
11
use Symfony \Component \Process \Process ;
10
12
use Webmozart \Assert \Assert ;
@@ -17,13 +19,13 @@ class CliContext implements Context
17
19
private string |null $ output = null ;
18
20
private int |null $ exitCode = null ;
19
21
20
- /** @ When I run a command to download the latest version of an extension */
22
+ #[ When( ' I run a command to download the latest version of an extension ' )]
21
23
public function iRunACommandToDownloadTheLatestVersionOfAnExtension (): void
22
24
{
23
25
$ this ->runPieCommand (['download ' , 'asgrim/example-pie-extension ' ]);
24
26
}
25
27
26
- /** @ When I run a command to download version :version of an extension */
28
+ #[ When( ' I run a command to download version :version of an extension ' )]
27
29
public function iRunACommandToDownloadSpecificVersionOfAnExtension (string $ version ): void
28
30
{
29
31
$ this ->runPieCommand (['download ' , 'asgrim/example-pie-extension: ' . $ version ]);
@@ -48,28 +50,28 @@ private function assertCommandSuccessful(): void
48
50
Assert::notNull ($ this ->output );
49
51
}
50
52
51
- /** @ Then the latest version should have been downloaded */
53
+ #[ Then( ' the latest version should have been downloaded ' )]
52
54
public function theLatestVersionShouldHaveBeenDownloaded (): void
53
55
{
54
56
$ this ->assertCommandSuccessful ();
55
57
Assert::regex ($ this ->output , '#Found package: asgrim/example-pie-extension:v?\d+\.\d+\.\d+ which provides ext-example_pie_extension# ' );
56
58
Assert::regex ($ this ->output , '#Extracted asgrim/example-pie-extension:v?\d+\.\d+\.\d+ source to: # ' );
57
59
}
58
60
59
- /** @ Then version :version should have been downloaded */
61
+ #[ Then( ' version :version should have been downloaded ' )]
60
62
public function versionOfTheExtensionShouldHaveBeen (string $ version ): void
61
63
{
62
64
$ this ->assertCommandSuccessful ();
63
65
Assert::contains ($ this ->output , 'Found package: asgrim/example-pie-extension: ' . $ version );
64
66
}
65
67
66
- /** @ When I run a command to build an extension */
68
+ #[ When( ' I run a command to build an extension ' )]
67
69
public function iRunACommandToBuildAnExtension (): void
68
70
{
69
71
$ this ->runPieCommand (['build ' , 'asgrim/example-pie-extension ' ]);
70
72
}
71
73
72
- /** @ Then /^ the extension should have been built$/ */
74
+ #[ Then( ' the extension should have been built ' )]
73
75
public function theExtensionShouldHaveBeenBuilt (): void
74
76
{
75
77
$ this ->assertCommandSuccessful ();
@@ -85,13 +87,13 @@ public function theExtensionShouldHaveBeenBuilt(): void
85
87
Assert::contains ($ this ->output , 'Build complete: ' );
86
88
}
87
89
88
- /** @ When /^ I run a command to build an extension with configure options$/ */
90
+ #[ When( ' I run a command to build an extension with configure options ' )]
89
91
public function iRunACommandToBuildAnExtensionWithConfigureOptions (): void
90
92
{
91
93
$ this ->runPieCommand (['build ' , 'asgrim/example-pie-extension ' , '--with-hello-name=sup ' ]);
92
94
}
93
95
94
- /** @ Then /^ the extension should have been built with options$/ */
96
+ #[ Then( ' the extension should have been built with options ' )]
95
97
public function theExtensionShouldHaveBeenBuiltWithOptions (): void
96
98
{
97
99
$ this ->assertCommandSuccessful ();
@@ -107,13 +109,13 @@ public function theExtensionShouldHaveBeenBuiltWithOptions(): void
107
109
Assert::contains ($ this ->output , 'Build complete: ' );
108
110
}
109
111
110
- /** @ When /^ I run a command to install an extension$/ */
112
+ #[ When( ' I run a command to install an extension ' )]
111
113
public function iRunACommandToInstallAnExtension (): void
112
114
{
113
115
$ this ->runPieCommand (['install ' , 'asgrim/example-pie-extension ' ]);
114
116
}
115
117
116
- /** @ Then /^ the extension should have been installed$/ */
118
+ #[ Then( ' the extension should have been installed ' )]
117
119
public function theExtensionShouldHaveBeenInstalled (): void
118
120
{
119
121
$ this ->assertCommandSuccessful ();
0 commit comments