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

LoveStack features: testing

Every LoveStack feature in Exponential is covered by PHPUnit tests in tests/tests/, written with the feature. This page lists them per feature and says how to run them.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/bc/6.0/love/TESTING.md

On this page

Testing

Every LoveStack feature in Exponential is covered by PHPUnit tests in tests/tests/, written with the feature. This page lists them per feature and says how to run them.

How to run them

Each test file runs on its own:

php vendor/bin/phpunit tests/tests/lib/ezutils/eZURIBuildTest.php

Most of them need no database. The few that do are marked live below: they belong to the PHPUnit group database, run on the installation the tests run on inside a transaction that is rolled back, and are skipped when there is no installation:

php vendor/bin/phpunit --group database tests/tests/kernel/content/eZAuditLocationTest.php

The installation is the siteaccess named in EXP_TEST_SITEACCESS, else DefaultAccess. Tests write only to a database with test as a word of its name (site_test, not latest): when the siteaccess's database is not one, they run on a throwaway database exp_test_* (kernel schema and clean data) that is dropped at the end, made with the account in EXP_TEST_DB_USER/EXP_TEST_DB_PASSWORD (default: the siteaccess's database settings), which needs CREATE and DROP on exp\_test\_%. EXP_TEST_KEEP_DATABASES=1 keeps them and lists them in var/log/test-databases.log. Without such an account the tests are skipped, and the message names the siteaccess, the database and the reason. The test classes on ezpDatabaseTestCase always get a throwaway database of their own. tests/runtests.php --db-per-test --dsn=… empties only a database with test, tests or testdb as a word of its name (testdb, not expdemolatest).

To run only the tests of the files a change touched (instead of the whole suite), see run only the tests of a change: tests/test-map.json maps source files, templates and scripts to the tests that cover them.

One test checks every default an upgraded site keeps, so a later change cannot switch a feature on by accident: tests/tests/kernel/classes/expShippedFeatureDefaultsTest.php (L01, L02, L05, L07, L08, L10, L13, L14, L18, L19, L22, L23, L27, L29, L30, L32, L33).

Per feature

Paths are relative to tests/tests/.

Security and sessions

IDTestWhat it checks
L01extension/ezjscore/ezjscServerRouterPolicyTest.phpezjscnode refused without ezjscore / call when RequirePolicy=enabled, allowed with it, unchanged when disabled or not set; 403 only when every call is refused for that reason
L02kernel/classes/expPolicyOmitListTest.php, kernel/content/eZLoginTemplatesRegisterLinkTest.phpPolicyOmitListExclude[] takes an entry out after every file is merged; every login template asks can_open before it shows the register link
L03kernel/classes/eZUserLogoutTest.phpafter logout the session and its id are gone, through every handler, and the cookie is expired with the same path, domain, Secure, HttpOnly, SameSite; a session left running is not written back
L04kernel/classes/expUserLoginIntegrityTest.phpduplicates found (including case), the index refused while there are duplicates and added after
L05kernel/classes/expImageUploadValidatorTest.php, extension/ezjscore/ezjscServerFunctionsAjaxUploaderImageTest.phpJPEG, PNG, GIF, WebP, AVIF accepted; a PHP file named .jpg refused; SVG refused unless listed; the AJAX uploader refuses before it stores
L06kernel/classes/packages/eZStylePackageCreatorTest.phppackage thumbnails and style images checked by content
SameSitelib/ezsession/eZSessionSameSiteAliasTest.phpSameSite read when CookieSameSite is unset; CookieSameSite wins

Diagnostics and logging

IDTestWhat it checks
L07lib/ezutils/eZDebugDeprecatedTest.phpa deprecation goes to deprecated.log, is counted, is not kept in memory
L08lib/ezfile/eZLogMaxSizeTest.phprotation at the INI size; the constant and setMaxLogSize() still win
L09lib/eztemplate/eZTemplateOperatorDefaultWarningTest.phpthe warning names operator and parameter, once
L10kernel/common/eZTemplatesStatisticsReporterEditUrlTest.phpthe edit link follows UsedTemplateEditUrl; empty gives the usual link
L11lib/ezdb/eZDBExceptionCodeTest.phpgetCode() is the driver's error number
L12kernel/classes/eZContentCacheManagerThresholdWarningTest.phpthe warning text with node count and threshold

Content, datatypes and the administration

IDTestWhat it checks
L13kernel/content/eZAuditLocationTest.php (live)adding, removing and changing the main location each write their event with the object and node ids
L14kernel/content/eZContentFunctionCollectionSiteDataTest.php, kernel/classes/eZSiteDataCreateTest.php, kernel/classes/eZSiteDataCreateNewLiveTest.php (live)listed names readable, others not; create() and createNew()
L15kernel/content/eZAdminFullViewCopyButtonTest.phpthe Copy button between Move and Remove, enabled only with create access at the parent
L16kernel/classes/datatypes/eZImageTypeAltTextTest.php, extension/ezjscore/ezjscServerFunctionsAjaxUploaderAltTextTest.phprequired alt text refused when empty, accepted when given; off by default; the AJAX uploader's field
L17kernel/classes/datatypes/eZStringTypeTrimTest.phpthe stored value trimmed only with the option
L18kernel/classes/eZNamePatternResolverClassTest.php, kernel/classes/eZNamePatternResolverLimitTest.phpa listed class is used; an unlisted one ignored and logged; normal patterns and the length limit unchanged
L19kernel/content/eZContentFunctionCollectionClassFilterTypeTest.phpempty setting: today's results; include: filtered
L20kernel/content/eZEditLocationsVisibilityTest.phpan existing location starts at "Unchanged"
L21kernel/datatypes/eZSelectionMatrixViewTemplateTest.phpno stray <br />

Rich text editor

IDTestWhat it checks
L22extension/ezoe/expOECustomTagListTest.phphidden tags not offered, still rendered and editable where they exist
L23extension/ezoe/expOECustomTagAssetsTest.phpthe stylesheet for the editor and its dialogs, valid plugin scripts, the styled classes, the example image in the dialog
L24—a JavaScript dialog, checked in the browser on TinyMCE 3 and Tiptap

Developer APIs and settings

IDTestWhat it checks
L25lib/ezutils/eZURIBuildTest.phprelative and full URLs, siteaccess in URL and host modes, the same result as ezurl
L26lib/ezutils/eZMailTransportSendTest.phpthe given transport is used for one message only
L27kernel/common/eZTemplateRawURLEncodeOperatorTest.phprawurlencode / rawurldecode, and an unset value with and without compilation
L28lib/ezutils/eZINIIncludeTest.phprelative glob, nesting, loops, a missing file, an override that includes, the INI cache recording the included files and seeing their changes
L29kernel/error/ErrorHeaderListTest.phpheaders from HeaderList[], invalid ones left out, sent again from the view cache
L30extension/ezjscore/ezjscServerFunctionsJsSearchSortByTest.phpthe search order from SortBy[]
L31kernel/common/eZTemplateDesignResourceSetKeyValueTest.phpsetKeyValue() and the layout key
IDTestWhat it checks
L32lib/ezutils/eZSysRequestURIDecodeOnceTest.phpoff: today's decoding; on: %2B stays +
L33lib/ezi18n/eZCharTransformTrailingCleanupTest.phpoff: aliases unchanged; on: LoveStack's cases
L34kernel/search/eZSearchEngineIntegerClampTest.phpvalues beyond the column range indexed without an error, per driver
L35kernel/datatypes/eZObjectRelationMetaDataTest.phprelated objects' relation fields left out, a cycle of relations included
L36kernel/classes/runnable/HideCronjobSearchIndexTest.php, kernel/classes/eZContentCacheEventSendersTest.phpthe hide cronjob updates the index; every sender of content/cache passes object ids

PHP 8 review, migration and LoveStack's own tests

  • PHP 8 review: one regression test per site, listed in PHP8-REVIEW.md.
  • Migration: kernel/classes/expLoveStackCheckTest.php and kernel/classes/expLoveStackMigrateTest.php on LoveStack-shaped and Exponential-shaped fixture databases; nothing is written by check, and migrate changes only its two rows and is idempotent.
  • LoveStack's own test cases for behaviour Exponential has: TESTS-MAPPING.md.

The URL options L32 and L33 were also compared over the URL aliases of a whole site with the options off and on: switching L32 on changed none of the request paths, and switching L33 on changed only the IRI aliases that contain a double quote.

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