Skip to content

Commit 408abdd

Browse files
committed
go e2e wip
1 parent 2527c9d commit 408abdd

7 files changed

Lines changed: 44 additions & 1 deletion

File tree

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
export GOFLAGS=-mod=mod
22

3+
.PHONY: FORCE
4+
FORCE:;
5+
36
.PHONY: vendor
47
vendor:
58
composer install --no-dev --prefer-dist
@@ -10,3 +13,13 @@ bin: vendor
1013
test-%: %
1114
export PATH="$(shell pwd)/$*:$(shell echo $$PATH)" && \
1215
go test -count=1 ./...
16+
17+
tests/data/releases-%.json: FORCE
18+
curl 'https://www.php.net/releases/index.php?json&max=1000&version=$*' | jq . > ./tests/data/releases-$*.json
19+
20+
resources/all-versions.json: bin tests/data/releases-5.json tests/data/releases-7.json tests/data/releases-8.json
21+
./bin/update-all-versions
22+
23+
txtar: bin resources/all-versions.json
24+
go generate ./...
25+
UPDATE_SCRIPTS=1 PATH=$(shell pwd)/bin:$$PATH go test ./...
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"github.com/typisttech/php-matrix/internal"
77
)
88

9-
//go:generate go run ./main.go
109
func Test(t *testing.T) {
1110
internal.RunTestscript(t)
1211
}
File renamed without changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
! exec php-matrix composer --not-an-option=bad
2+
! stdout .
3+
cmp stderr stderr.golden
4+
5+
-- stderr.golden --
6+
7+
8+
The "--not-an-option" option does not exist.
9+
10+
11+
composer [--source SOURCE] [--mode MODE] [--] [<path>]
12+
13+
-- composer.json --
14+
{"require":{"php":"^7.4"}}
File renamed without changes.
File renamed without changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
! exec php-matrix composer composer.json composer2.json
2+
! stdout .
3+
cmp stderr stderr.golden
4+
5+
-- stderr.golden --
6+
7+
8+
Too many arguments to "composer" command, expected arguments "path".
9+
10+
11+
composer [--source SOURCE] [--mode MODE] [--] [<path>]
12+
13+
-- composer.json --
14+
{"require":{"php":"^7.4"}}
15+
16+
-- composer2.json --
17+
{"require":{"php":"^8.0"}}

0 commit comments

Comments
 (0)