Skip to content

Commit 2ab86f8

Browse files
committed
standalone CI job
1 parent b8cc9fb commit 2ab86f8

2 files changed

Lines changed: 44 additions & 1 deletion

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: PHPStan Printer Test
2+
3+
on:
4+
pull_request: null
5+
push:
6+
branches:
7+
- main
8+
9+
10+
11+
env:
12+
# see https://github.com/composer/composer/issues/9368#issuecomment-718112361
13+
COMPOSER_ROOT_VERSION: "dev-main"
14+
15+
jobs:
16+
tests:
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-latest, windows-latest]
21+
php-versions: ['8.2']
22+
23+
runs-on: ${{ matrix.os }}
24+
timeout-minutes: 3
25+
26+
name: PHP ${{ matrix.php-versions }} tests (${{ matrix.os }})
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
-
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php-versions }}
34+
coverage: none
35+
# to display warning when assert() is called, eg: on direct getArgs() on CallLike
36+
# and check against first class callable strlen(...)
37+
ini-values: zend.assertions=1
38+
39+
- uses: "ramsey/composer-install@v3"
40+
41+
- run: vendor/bin/phpunit tests/PhpParser/Printer/PHPStanPrinterTest.php --colors

tests/PhpParser/Printer/PHPStanPrinterTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ public function testAddingCommentOnSomeNodesFail(): void
2929
$innerParser = $parserReflectionProperty->getValue($phpstanParser);
3030
$tokens = $innerParser->getTokens();
3131

32-
$standardPrinter = new Standard();
32+
$standardPrinter = new Standard([
33+
'newline' => "\n",
34+
]);
3335
$printerContents = $standardPrinter->printFormatPreserving($stmts, $stmts, $tokens);
3436

3537
$this->assertStringEqualsFile(__DIR__ . '/Fixture/some_array_map.php', $printerContents);

0 commit comments

Comments
 (0)