Skip to content

Commit

Permalink
Fix the end-to-end tests (#201)
Browse files Browse the repository at this point in the history
- Update the end-to-end tests to use the new Box version
- Use PHP-Scoper current version for the Box PHP-Scoper
  • Loading branch information
theofidry authored May 11, 2018
1 parent eedf13a commit 8abd8de
Show file tree
Hide file tree
Showing 17 changed files with 2,282 additions and 3,268 deletions.
26 changes: 8 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ clean:

.PHONY: build
build: ## Build the PHAR
BOX=vendor-bin/box/vendor/bin/box
BOX=vendor/bin/box
build: bin/php-scoper.phar


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

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

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

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

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

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

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

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

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

vendor-bin/box/composer.lock: composer.lock
@echo composer.lock is not up to date.
@echo vendor-bin/box/composer.lock is not up to date.

vendor-bin/covers-validator/composer.lock: vendor-bin/covers-validator/composer.json
@echo covers-validator composer.lock is not up to date
Expand Down
4 changes: 4 additions & 0 deletions box.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"algorithm": "OPENSSL",
"key": ".travis/php-scoper-private.pem",

"files": [
"src/scoper.inc.php.tpl"
],

"compression": "GZ",

"compactors": [
Expand Down
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.1",
"humbug/box": "^3.0@dev",
"phpunit/phpunit": "^7.0"
},
"replace": {
"humbug/php-scoper": "self.version"
},

"bin": ["bin/php-scoper"],
"autoload": {
Expand Down
Loading

0 comments on commit 8abd8de

Please sign in to comment.