Download the PHP package konradmichalik/ttt without Composer

On this page you can find all versions of the php package konradmichalik/ttt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ttt

# *ttt* [![Coverage](https://img.shields.io/coverallsCoverage/github/konradmichalik/ttt?logo=coveralls)](https://coveralls.io/github/konradmichalik/ttt) [![CGL](https://img.shields.io/github/actions/workflow/status/konradmichalik/ttt/cgl.yml?label=cgl&logo=github)](https://github.com/konradmichalik/ttt/actions/workflows/cgl.yml) [![Tests](https://img.shields.io/github/actions/workflow/status/konradmichalik/ttt/tests.yml?label=tests&logo=github)](https://github.com/konradmichalik/ttt/actions/workflows/tests.yml) [![Supported PHP Versions](https://img.shields.io/packagist/dependency-v/konradmichalik/ttt/php?logo=php)](https://packagist.org/packages/konradmichalik/ttt)

ttt (TYPO3 Testing Terrarium) is a PHPUnit testing toolbox for TYPO3 extension development. At its core is declarative test sandboxing: TYPO3_CONF_VARS, environment variables, application context & more, put in place via PHP attributes and guaranteed to be cleaned up afterwards, whether the test passes, fails or errors. A Request kit, an Assertion kit, a Contract kit and a Fixture kit round out the rest of everyday TYPO3 test writing.

See Documentation index for the complete list of attributes, kits and concepts.

Before:

After:

See docs/why-not-backupglobals.md for how this differs from PHPUnit's built-in #[BackupGlobals].

🔥 Installation

Packagist Packagist Downloads

⚡ Usage

Register the extension once in your phpunit.xml:

That's it: all ttt attributes now work in every test. Attributes can be placed on classes and methods (class level is applied first, method level merges on top) and are repeatable.

Available attributes

Attribute Purpose
#[WithTypo3ConfVars] Deep-merges configuration into $GLOBALS['TYPO3_CONF_VARS'], full restore afterwards
#[WithTca] Deep-merges configuration into $GLOBALS['TCA'][$table], full restore afterwards
#[WithGlobal] Sets an arbitrary $GLOBALS entry, full restore afterwards (incl. previously unset keys)
#[WithEnvVar] Sets an environment variable (putenv(), $_ENV, $_SERVER), restores all three channels
#[WithEnvironment] Bootstraps Environment::initialize() in a temporary project directory incl. cleanup
#[InApplicationContext] Switches the TYPO3 application context for one test
#[WithSingleton] Registers a singleton via GeneralUtility, restores the previous singleton map
#[WithBackendUser] Provides a lightweight $GLOBALS['BE_USER'] stub and the matching Context backend.user aspect
#[WithFrontendUser] Provides a lightweight $GLOBALS['FE_USER'] stub and the matching Context frontend.user aspect
#[FreezeTime] Pins the Context date aspect and EXEC_TIME globals
#[InTimeZone] Sets the default timezone (date_default_timezone_set())
#[InLocale] Sets the locale (setlocale()) for a given category
#[WithStaticProperty] Generic escape hatch: overwrites any static property via reflection, full restore afterwards
#[WithInstance] Queues a fake via GeneralUtility::addInstance() for the next makeInstance() call

Kits

Kit Purpose
Request kit Fluent builder for TYPO3 ServerRequest objects
Assertion kit JSON path assertions with descriptive failure messages
Contract kit Generates violation-case tests from a validateConfiguration()-style contract
Fixture kit Disposable test fixtures (images, log files)

See docs/without-extension.md for the imperative alternative.

🧩 Extending

Custom attributes are two small classes: a DTO implementing TttAttribute and an AttributeHandler (a public API with a backward-compatibility promise) that applies the state and returns a restorer closure. Handlers must be stateless: all captured state belongs into the closure.

Register custom handlers via a comma-separated handlers parameter on the bootstrap extension; there's no need to replace TttExtension:

Custom handlers run after the built-in ones. A missing class or one that doesn't implement AttributeHandler fails fast with an actionable error naming the handlers parameter.

See docs/non-goals.md for what's deliberately out of scope, and why.

🧑‍💻 Contributing

Please have a look at CONTRIBUTING.md.

⭐ License

This project is licensed under GNU General Public License 3.0 (or later).


All versions of ttt with dependencies

PHP Build Version
Package Version
Requires php Version ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0
phpunit/phpunit Version ^10.5 || ^11.0 || ^12.0 || ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package konradmichalik/ttt contains the following files

Loading the files please wait ...