Skip to content

Update automatic Tests and introduce GitHub actions#260

Open
Martin-1997 wants to merge 2 commits into
masterfrom
ci/restore-github-actions-257
Open

Update automatic Tests and introduce GitHub actions#260
Martin-1997 wants to merge 2 commits into
masterfrom
ci/restore-github-actions-257

Conversation

@Martin-1997

Copy link
Copy Markdown
Collaborator

Tackels 1, and 2, of #257

Martin-1997 and others added 2 commits July 3, 2026 22:42
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant