Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Testing applications

A testing strategy for applications on Exponential - unit tests without a database, tests against a throwaway database, template and link checks, browser checks with a test user, accessibility, and what to run before…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/creators/app-creators/testing-applications.md

On this page

Testing applications

This page is for application creators who want to change code without fear. The kernel's own tests and gates are the model: most tests run without a database, a few against a throwaway one, and checks of templates, links and the browser complete the picture (Testing and CI standard).

Contents

  1. The layers
  2. Unit tests without a database
  3. Tests with a database
  4. Template, settings and link checks
  5. Browser checks
  6. Before every push

The layers

LayerToolCatches
Syntaxphp -l, eztemplatecheck.phpparse errors in PHP and templates
UnitPHPUnit, no databaselogic of services, validators, handlers
IntegrationPHPUnit with tests/runtests.php --dsn ...SQL, persistent objects, content operations
Rendered pagesHTTP requests, browser automationtemplates, permissions, redirects
Accessibility and CSPan automatic accessibility checker, the CSP report logbarriers, inline code

Unit tests without a database

Write the logic as plain classes (services) the view, command and cronjob call; test those with PHPUnit (DB-less PHPUnit tests). The kernel runs its whole default suite without a database: vendor/bin/phpunit excludes the database group.

Tests with a database

tests/runtests.php --dsn <dsn> --db-per-test runs the suites against a throwaway database, as CI's database job does. Mark such tests @group database. Never point tests at a database that holds real content.

php bin/php/eztemplatecheck.php -s<siteaccess> extension/expdemo/design/   # every template of your extension
./console exp:ini where expdemo.ini/ListSettings/DefaultLimit <siteaccess>  # settings resolve as expected
./console exp:help check                                                    # links in your extension's docs, when indexed

Browser checks

  • Use a dedicated test user created for the run and removed afterwards; never a shared administrator account, whose preferences belong to someone.
  • Check every page type of your extension logged out, as a restricted user and as an editor.
  • Check the browser console for errors and the CSP report log (var/log/csp.log) for blocked code (Content Security Policy for your code).
  • Run an accessibility checker on each page (Testing your site's accessibility).

Before every push

  • To do: php -l of changed PHP files; template check of changed templates.
  • To do: Unit tests of the changed code pass.
  • To do: No inline scripts or styles added.
  • To do: Autoloads regenerated if classes changed; caches cleared; the feature tried by hand.
  • To do: CI configured for the repository (Continuous integration for extensions).

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x