Skip to content

Commit 1bce0b4

Browse files
authored
Use bashunit for e2e tests
1 parent 093b35e commit 1bce0b4

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

Diff for: .github/workflows/e2e-tests.yml

+10-7
Original file line numberDiff line numberDiff line change
@@ -194,26 +194,26 @@ jobs:
194194
patch -b data/TraitOne.php < TraitOne.patch
195195
OUTPUT=$(../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/ || true)
196196
echo "$OUTPUT"
197-
[ $(echo "$OUTPUT" | wc -l) -eq 1 ]
198-
grep 'Method TraitsCachingIssue\\TestClassUsingTrait::doBar() should return stdClass but returns Exception.' <<< "$OUTPUT"
197+
../bashunit -a line_count 1 "$OUTPUT"
198+
../bashunit -a contains 'Method TraitsCachingIssue\TestClassUsingTrait::doBar() should return stdClass but returns Exception.' "$OUTPUT"
199199
- script: |
200200
cd e2e/trait-caching
201201
../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/
202202
patch -b data/TraitTwo.php < TraitTwo.patch
203203
OUTPUT=$(../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/ || true)
204204
echo "$OUTPUT"
205-
[ $(echo "$OUTPUT" | wc -l) -eq 1 ]
206-
grep 'Method class@anonymous/TestClassUsingTrait.php:20::doBar() should return stdClass but returns Exception.' <<< "$OUTPUT"
205+
../bashunit -a line_count 1 "$OUTPUT"
206+
../bashunit -a contains 'Method class@anonymous/TestClassUsingTrait.php:20::doBar() should return stdClass but returns Exception.' "$OUTPUT"
207207
- script: |
208208
cd e2e/trait-caching
209209
../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/
210210
patch -b data/TraitOne.php < TraitOne.patch
211211
patch -b data/TraitTwo.php < TraitTwo.patch
212212
OUTPUT=$(../../bin/phpstan analyze --no-progress --level 8 --error-format raw data/ || true)
213213
echo "$OUTPUT"
214-
[ $(echo "$OUTPUT" | wc -l) -eq 2 ]
215-
grep 'Method TraitsCachingIssue\\TestClassUsingTrait::doBar() should return stdClass but returns Exception.' <<< "$OUTPUT"
216-
grep 'Method class@anonymous/TestClassUsingTrait.php:20::doBar() should return stdClass but returns Exception.' <<< "$OUTPUT"
214+
../bashunit -a line_count 2 "$OUTPUT"
215+
../bashunit -a contains 'Method TraitsCachingIssue\TestClassUsingTrait::doBar() should return stdClass but returns Exception.' "$OUTPUT"
216+
../bashunit -a contains 'Method class@anonymous/TestClassUsingTrait.php:20::doBar() should return stdClass but returns Exception.' "$OUTPUT"
217217
218218
steps:
219219
- name: "Checkout"
@@ -233,6 +233,9 @@ jobs:
233233
- name: "Patch PHPStan"
234234
run: "patch src/Analyser/Error.php < e2e/PHPStanErrorPatch.patch"
235235

236+
- name: "Install bashunit"
237+
run: "curl -s https://bashunit.typeddevs.com/install.sh | bash -s e2e/ beta"
238+
236239
- name: "Test"
237240
run: "${{ matrix.script }}"
238241

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
/tests/.phpunit.result.cache
1010
/tests/PHPStan/Reflection/data/golden/
1111
tmp/.memory_limit
12+
e2e/bashunit

0 commit comments

Comments
 (0)