Skip to content

Commit 8abd8de

Browse files
authored
Fix the end-to-end tests (#201)
- Update the end-to-end tests to use the new Box version - Use PHP-Scoper current version for the Box PHP-Scoper
1 parent eedf13a commit 8abd8de

File tree

17 files changed

+2282
-3268
lines changed

17 files changed

+2282
-3268
lines changed

Makefile

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ clean:
1818

1919
.PHONY: build
2020
build: ## Build the PHAR
21-
BOX=vendor-bin/box/vendor/bin/box
21+
BOX=vendor/bin/box
2222
build: bin/php-scoper.phar
2323

2424

@@ -57,30 +57,24 @@ PHPSCOPER=bin/php-scoper.phar
5757
.PHONY: e2e_004
5858
e2e_004: ## Run end-to-end tests for the fixture set 004: source code case
5959
e2e_004: bin/php-scoper.phar
60-
$(PHPNOGC) $(PHPSCOPER) add-prefix --working-dir=fixtures/set004 --output-dir=../../build/set004 --force --no-config --no-interaction --stop-on-failure
61-
composer --working-dir=build/set004 dump-autoload
62-
$(PHPNOGC) $(BOX) compile -c build/set004/box.json.dist
60+
$(PHPNOGC) $(BOX) compile --working-dir fixtures/set004
6361

6462
php build/set004/bin/greet.phar > build/set004/output
6563
diff fixtures/set004/expected-output build/set004/output
6664

6765
.PHONY: e2e_005
6866
e2e_005: ## Run end-to-end tests for the fixture set 005: third-party code case
6967
e2e_005: bin/php-scoper.phar fixtures/set005/vendor
70-
$(PHPNOGC) $(PHPSCOPER) add-prefix --working-dir=fixtures/set005 --output-dir=../../build/set005 --force --no-config --no-interaction --stop-on-failure
71-
composer --working-dir=build/set005 dump-autoload
72-
$(PHPNOGC) $(BOX) compile -c build/set005/box.json.dist
68+
$(PHPNOGC) $(BOX) compile --working-dir fixtures/set005
7369

7470
php build/set005/bin/greet.phar > build/set005/output
7571
diff fixtures/set005/expected-output build/set005/output
7672

7773
.PHONY: e2e_011
7874
e2e_011: ## Run end-to-end tests for the fixture set 011: whitelist case
7975
e2e_011: bin/php-scoper.phar fixtures/set011/vendor
80-
$(PHPNOGC) $(PHPSCOPER) add-prefix --working-dir=fixtures/set011 --output-dir=../../build/set011 --force --no-interaction --stop-on-failure
81-
cp -R fixtures/set011/tests build/set011/
82-
composer --working-dir=build/set011 dump-autoload
83-
$(PHPNOGC) $(BOX) compile -c build/set011/box.json.dist
76+
$(PHPNOGC) $(BOX) compile --working-dir fixtures/set011
77+
cp -R fixtures/set011/tests/ build/set011/tests/
8478

8579
php build/set011/bin/greet.phar > build/set011/output
8680
diff fixtures/set011/expected-output build/set011/output
@@ -96,19 +90,15 @@ e2e_013: bin/php-scoper.phar
9690
.PHONY: e2e_014
9791
e2e_014: ## Run end-to-end tests for the fixture set 014: source code case with psr-0
9892
e2e_014: bin/php-scoper.phar
99-
$(PHPNOGC) $(PHPSCOPER) add-prefix --working-dir=fixtures/set014 --output-dir=../../build/set014 --force --no-config --no-interaction --stop-on-failure
100-
composer --working-dir=build/set014 dump-autoload
101-
$(PHPNOGC) $(BOX) compile -c build/set014/box.json.dist
93+
$(PHPNOGC) $(BOX) compile --working-dir fixtures/set014
10294

10395
php build/set014/bin/greet.phar > build/set014/output
10496
diff fixtures/set014/expected-output build/set014/output
10597

10698
.PHONY: e2e_015
10799
e2e_015: ## Run end-to-end tests for the fixture set 015: third-party code case with psr-0
108100
e2e_015: bin/php-scoper.phar fixtures/set015/vendor
109-
$(PHPNOGC) $(PHPSCOPER) add-prefix --working-dir=fixtures/set015 --output-dir=../../build/set015 --force --no-config --no-interaction --stop-on-failure
110-
composer --working-dir=build/set015 dump-autoload
111-
$(PHPNOGC) $(BOX) compile -c build/set015/box.json.dist
101+
$(PHPNOGC) $(BOX) compile --working-dir fixtures/set015
112102

113103
php build/set015/bin/greet.phar > build/set015/output
114104
diff fixtures/set015/expected-output build/set015/output
@@ -236,7 +226,7 @@ composer.lock: composer.json
236226
@echo composer.lock is not up to date.
237227

238228
vendor-bin/box/composer.lock: composer.lock
239-
@echo composer.lock is not up to date.
229+
@echo vendor-bin/box/composer.lock is not up to date.
240230

241231
vendor-bin/covers-validator/composer.lock: vendor-bin/covers-validator/composer.json
242232
@echo covers-validator composer.lock is not up to date

box.json.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
"algorithm": "OPENSSL",
55
"key": ".travis/php-scoper-private.pem",
66

7+
"files": [
8+
"src/scoper.inc.php.tpl"
9+
],
10+
711
"compression": "GZ",
812

913
"compactors": [

composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@
2828
},
2929
"require-dev": {
3030
"bamarni/composer-bin-plugin": "^1.1",
31+
"humbug/box": "^3.0@dev",
3132
"phpunit/phpunit": "^7.0"
3233
},
34+
"replace": {
35+
"humbug/php-scoper": "self.version"
36+
},
3337

3438
"bin": ["bin/php-scoper"],
3539
"autoload": {

0 commit comments

Comments
 (0)