Skip to content

Commit

Permalink
E2E test
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Dec 13, 2020
1 parent 66c7adc commit 7418efb
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/e2e export-ignore
45 changes: 45 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "Integration tests"

on:
pull_request:
push:
branches:
- "master"

jobs:
test:
name: "Integration test"
runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"
- "8.0"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"

- name: "Install dependencies"
working-directory: "e2e"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Test"
working-directory: "e2e"
run: "vendor/bin/phpstan analyse -l 8 FooTest.php"

- name: "Rename directory"
run: "mv e2e e3e"

- name: "Test relative paths - after renaming"
working-directory: "e3e"
run: "vendor/bin/phpstan analyse -l 8 FooTest.php"
2 changes: 2 additions & 0 deletions e2e/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/composer.lock
/vendor
21 changes: 21 additions & 0 deletions e2e/FooTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace App;

use PHPUnit\Framework\TestCase;

class FooTest extends TestCase
{

public function testFoo(?\stdClass $std): void
{
$this->assertNotNull($std);
$this->requireStd($std);
}

private function requireStd(\stdClass $std): void
{

}

}
17 changes: 17 additions & 0 deletions e2e/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"require": {
"phpstan/phpstan": "^0.12.62",
"phpstan/extension-installer": "dev-master",
"phpstan/phpstan-phpunit": "^0.12.17",
"phpunit/phpunit": "^9.5"
},
"repositories": [
{
"type": "path",
"url": "..",
"options": {
"symlink": false
}
}
]
}

0 comments on commit 7418efb

Please sign in to comment.