File tree Expand file tree Collapse file tree 8 files changed +111
-13
lines changed Expand file tree Collapse file tree 8 files changed +111
-13
lines changed Original file line number Diff line number Diff line change 1
1
/build /
2
+ /box.json
2
3
/composer.lock
3
4
/vendor /
4
5
/.php_cs.cache
Original file line number Diff line number Diff line change 1
1
language : php
2
-
3
2
matrix :
4
- include :
5
- - php : 7.1
6
- - php : 7.2
7
- env : deps=low
8
- fast_finish : true
9
-
10
- before_script :
11
- - phpenv config-rm xdebug.ini
12
- - if [[ $deps = low ]]; then make update-min; else make install; fi
13
-
3
+ include :
4
+ - php : 7.1
5
+ env : EXECUTE_DEPLOYMENT=true
6
+ - php : 7.2
7
+ env : deps=low
8
+ fast_finish : true
9
+ before_install :
10
+ - |
11
+ if [ 'jakzal/phpunit-injector' == "$TRAVIS_PULL_REQUEST_SLUG" ]; then
12
+ openssl aes-256-cbc -K $encrypted_a7af76e39835_key -iv $encrypted_a7af76e39835_iv -in .travis/secrets.tar.enc -out .travis/secrets.tar -d
13
+ tar xvf .travis/secrets.tar -C .travis
14
+ fi;
15
+ - phpenv config-rm xdebug.ini
16
+ install :
17
+ - if [[ $deps = low ]]; then make update-min; else make install; fi
14
18
script :
15
- - if [[ $deps = low ]]; then make test-min; else make test; fi
19
+ - if [[ $deps = low ]]; then make test-min; else make test; fi
20
+ - make package
21
+ deploy :
22
+ provider : releases
23
+ api_key :
24
+ secure : jn8Dw+WwWEnkF9BulSd8Jsah4piDP5KZYQd8ybV/JNAXwSUm5HQbZ8mCrVnWd/vqVCtnMPg+8+axU6bkhfAKZl7RHSwM0ZT3iJHNxQLwicOlx4MTgrwvD7HS3zf3WsguA84vNqipr+p/zzezhxzHALX6w7EkjqtF7MfC9H9jq7qPloaPzEqsLbwHnAV4usWTe1E7fNJ03LlJwgpiiU8TaGFJ+UVsuM7wcuGree0A8mttSd7ytE8s1mB2ph3UpXC7izSa/DXa3vOXXlB1AOKCbeunL0arKYGLrwmJq3wVw4oZSnCxgfM2P0uOwjQ7LhBF+OfQpnnS63OAlzeCQrOmMfXfdx8V8SyrjOeA1377MnrElbKgW/r4MGW0/cB1GMwSvsioJBMODFSRKmQH+TCcSpFHyzIij4QzWrfln7URpnRC1Vs0rOfZX+15iyyhI/UatNTrMlQXtIqJENeIg41PMqbmHMcQj63Wtz0DOJ+bBnWx3vsD+s7inuplkGo/JOjPXL4FMCRQvgFQNjoGNTrfoS6G7Ex4SV7toy26L8vzn5g2zys7dnF4mPQZRo81IFw++zP6dGYEbb+XJwNiVix/otKxA3d8PsnUj4zWqrYRBZIXntW1Gipgm3pKfQcuLE55witt5CPucIRYCph3MXB+6Tp+e2m5JaolknSN9LUgFK0=
25
+ file :
26
+ - build/zalas-phpunit-injector-extension.phar
27
+ - build/zalas-phpunit-injector-extension.phar.pubkey
28
+ skip_cleanup : true
29
+ on :
30
+ tags : true
31
+ repo : jakzal/phpunit-injector
32
+ condition : " $EXECUTE_DEPLOYMENT"
Original file line number Diff line number Diff line change
1
+ * .pem
2
+ secrets.tar
Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ update-min:
15
15
composer update --prefer-stable --prefer-lowest
16
16
.PHONY : update-min
17
17
18
+ update-no-dev :
19
+ composer update --prefer-stable --no-dev
20
+ .PHONY : update-no-dev
21
+
18
22
test : vendor cs deptrac phpunit infection
19
23
.PHONY : test
20
24
@@ -41,9 +45,31 @@ phpunit: tools/phpunit
41
45
tools/phpunit
42
46
.PHONY : phpunit
43
47
44
- tools : tools/php-cs-fixer tools/deptrac tools/infection
48
+ tools : tools/php-cs-fixer tools/deptrac tools/infection tools/box
45
49
.PHONY : tools
46
50
51
+ clean :
52
+ rm -rf build
53
+ .PHONY : clean
54
+
55
+ package : tools/box
56
+ $(eval VERSION=$(shell git describe --abbrev=0 --tags 2> /dev/null | sed -e 's/^v//' || echo 'dev') )
57
+ @rm -rf build/phar && mkdir -p build/phar
58
+
59
+ cp -r src LICENSE composer.json build/phar
60
+ sed -e 's/@@version@@/$(VERSION)/g' manifest.xml.in > build/phar/manifest.xml
61
+ [ -f .travis/phpunit-injector-extension-private.pem ] || cat box.json.dist | sed -e '/\"key\": \".*\",/d' -e '/\"algorithm\": \".*\",/d' > box.json
62
+
63
+ cd build/phar && \
64
+ composer remove phpunit/phpunit --no-update && \
65
+ composer config platform.php 7.1 && \
66
+ composer update --no-dev -o -a
67
+
68
+ tools/box compile
69
+
70
+ @rm -rf build/phar
71
+ .PHONY : package
72
+
47
73
vendor : install
48
74
49
75
vendor/bin/phpunit : install
@@ -62,3 +88,6 @@ tools/infection: tools/infection.pubkey
62
88
63
89
tools/infection.pubkey :
64
90
curl -Ls https://github.com/infection/infection/releases/download/0.8.1/infection.phar.pubkey -o tools/infection.pubkey
91
+
92
+ tools/box :
93
+ curl -Ls https://github.com/humbug/box/releases/download/3.0.0-beta.0/box.phar -o tools/box && chmod +x tools/box
Original file line number Diff line number Diff line change @@ -11,10 +11,27 @@ to any property tagged with `@inject`.
11
11
12
12
## Installation
13
13
14
+ ### Composer
15
+
14
16
``` bash
15
17
composer require --dev zalas/phpunit-injector
16
18
```
17
19
20
+ ### Phar
21
+
22
+ The extension is also distributed as a PHAR, which can be downloaded together with its pubkey from the most recent
23
+ [ Github Release] ( https://github.com/jakzal/phpunit-injector/releases ) .
24
+
25
+ Put the extension and its key in your PHPUnit extensions directory.
26
+ Remember to instruct PHPUnit to load extensions in your ` phpunit.xml ` :
27
+
28
+ ``` xml
29
+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/7.0/phpunit.xsd"
30
+ extensionsDirectory =" tools/phpunit.d"
31
+ >
32
+ </phpunit >
33
+ ```
34
+
18
35
## Configuration
19
36
20
37
Enable the service injector listener
Original file line number Diff line number Diff line change
1
+ {
2
+ "base-path": "build/phar",
3
+ "output": "../zalas-phpunit-injector-extension.phar",
4
+ "algorithm": "OPENSSL",
5
+ "key": ".travis/phpunit-injector-extension-private.pem",
6
+ "compression": "GZ",
7
+ "directories": ["."],
8
+ "dump-autoload": true,
9
+ "exclude-composer-files": true,
10
+ "check-requirements": false,
11
+ "main": "vendor/autoload.php",
12
+ "banner": [
13
+ "This file is part of the zalas/phpunit-injector project.",
14
+ "",
15
+ "(c) Jakub Zalas <jakub@zalas.pl>"
16
+ ]
17
+ }
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <phar xmlns =" https://phar.io/xml/manifest/1.0" >
3
+ <contains name =" zalas/phpunit-injector" version =" @@version@@" type =" extension" >
4
+ <extension for =" phpunit/phpunit" compatible =" ^7.0" />
5
+ </contains >
6
+
7
+ <copyright >
8
+ <author name =" Jakub Zalas" email =" oss@zalas.pl" />
9
+ <license type =" MIT" url =" https://github.com/jakzal/phpunit-injector/blob/master/LICENSE" />
10
+ </copyright >
11
+
12
+ <requires >
13
+ <php version =" ^7.1" />
14
+ </requires >
15
+ </phar >
You can’t perform that action at this time.
0 commit comments