Update automatic Tests and introduce GitHub actions#260
Open
Martin-1997 wants to merge 2 commits into
Open
Conversation
Replaces the abandoned christophwurst/nextcloud dev stub with nextcloud/ocp so PHPUnit and PHPStan can resolve OCP types without a live Nextcloud install. Modernizes tests/Unit/Controller/PageControllerTest.php to PHPUnit\Framework\TestCase / setUp(): void and fixes it to match PageController's actual constructor (IUserSession, not a raw user id string) — it was silently stale. tests/bootstrap.php now just loads Composer's autoloader; the old full-server bootstrap moves to tests/bootstrap.integration.php for the (still server-dependent) integration suite, which gets its own `make test-integration` target since `make test` previously installed deps with --no-dev and would have stripped PHPUnit itself. Adds a PHPStan config (level 3) with a baseline freezing the 237 pre-existing findings (missing Doctrine DBAL stub types, plus a runtime class_alias() static analysis can't see through — mirrored in tests/phpstan-bootstrap.php) so analysis starts green and only flags newly introduced issues. Verified: make test, composer run lint, composer run phpstan, and composer run test:unit all pass on PHP 8.2, 8.3, and 8.5. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
.travis.yml was pinned to PHP 5.6-7.1 and long dead. Adds three free GitHub Actions workflows (unlimited minutes on public repos), each a simplified adaptation of Nextcloud's reusable workflow templates (nextcloud/.github): - lint-php.yml: composer validate + php -l, matrix over PHP 8.2/8.3 - static-analysis.yml: PHPStan against the baseline added in the previous commit - phpunit.yml: the unit suite only (no live server/DB needed, so no external services to boot); the server-backed integration suite is intentionally deferred to the multi-database CI follow-up from the linked issue Closes #257 (steps 1 and 2 only; unit tests for mappers/report queries and multi-database CI remain as follow-up). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tackels 1, and 2, of #257