File tree 3 files changed +12
-14
lines changed
3 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 2
2
"name" : " jigarius/phpake" ,
3
3
"description" : " Phpake is a make-like utility built for PHP." ,
4
4
"license" : " GPL-3.0-only" ,
5
- "version" : " 1.0.0" ,
6
- "keywords" : [],
5
+ "keywords" : [" make" ],
7
6
"authors" : [
8
7
{
9
8
"name" : " Jerry Radwick" ,
Original file line number Diff line number Diff line change 2
2
3
3
namespace Phpake ;
4
4
5
+ use Composer \InstalledVersions ;
5
6
use Symfony \Component \Console \Application ;
6
7
use Symfony \Component \Console \Input \InputInterface ;
7
8
use Symfony \Component \Console \Input \ArgvInput ;
@@ -32,12 +33,15 @@ class Phpake extends Application {
32
33
* Creates a Phpake Application instance.
33
34
*/
34
35
public function __construct () {
35
- parent ::__construct ();
36
- $ this ->setName (self ::NAME );
37
- $ this ->setVersion (self ::VERSION );
36
+ parent ::__construct (
37
+ self ::NAME ,
38
+ InstalledVersions::getPrettyVersion ('jigarius/phpake ' ),
39
+ );
38
40
41
+ // @todo Not required. Remove after refactoring.
39
42
$ this ->input = new ArgvInput ();
40
43
$ this ->output = new ConsoleOutput ();
44
+
41
45
$ this ->configureIO ($ this ->input , $ this ->output );
42
46
}
43
47
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
+ use Composer \InstalledVersions ;
3
4
use Phpake \Phpake ;
4
5
use Phpake \TestCase ;
5
6
@@ -18,16 +19,10 @@ public function testName() {
18
19
19
20
public function testVersion () {
20
21
$ app = new Phpake ();
21
- $ this ->assertMatchesRegularExpression (
22
- ' /^\d+\.\d+.\d+(-(alpha|beta|rc)\.\d+)?$/ ' ,
23
- $ app ->getVersion ()
22
+ $ this ->assertEquals (
23
+ InstalledVersions:: getPrettyVersion ( ' jigarius/phpake ' ) ,
24
+ $ app ->getVersion ()
24
25
);
25
-
26
- $ json_path = dirname (__DIR__ ) . DIRECTORY_SEPARATOR . 'composer.json ' ;
27
- $ json_data = json_decode (file_get_contents ($ json_path ));
28
-
29
- $ this ->assertNotEmpty ($ json_data ->version );
30
- $ this ->assertEquals ($ json_data ->version , $ app ->getVersion ());
31
26
}
32
27
33
28
public function testRequire () {
You can’t perform that action at this time.
0 commit comments