Download the PHP package marko/testing without Composer

On this page you can find all versions of the php package marko/testing. 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 testing

marko/testing

Testing utilities for Marko---reusable fakes with built-in assertions, and an in-process HTTP test client for feature tests.

Overview

marko/testing provides a set of in-memory fakes that replace real infrastructure dependencies during tests. Instead of mocking interfaces by hand or spinning up real services, you drop in a fake, run your code, and call assertion methods directly on the fake. This removes hundreds of lines of boilerplate and keeps tests focused on behavior.

Installation

Pest Base Test Case

TestCase registers PSR-4 autoloaders for app/* and modules/* before tests run, so module classes resolve without per-project Composer classmap configuration. No container or application boot is performed.

Wire it as the global base in tests/Pest.php:

After that, every Pest test in the project can reference module and app classes directly---no additional Composer path repos or classmaps required.

HTTP Tests

TestClient sends requests through your application in process (real router, middleware and controllers) and boots the application once for many requests:

Cookies persist across requests like a browser's, so session-backed flows work. Assertions on the returned TestResponse throw AssertionFailedException with the status and a body excerpt. See the HTTP tests docs.

Database Tests

With marko/database and a driver installed, TestDatabase boots and migrates your application once per process, and RefreshDatabase wraps each test in a transaction that is rolled back afterwards:

TruncateDatabase empties the entity tables instead, for code that must see committed data. Both refuse to run in production, and TruncateDatabase runs only in a testing environment (testing, test); set APP_ENV=testing. See the database tests docs.

Available Fakes

FakeEventDispatcher, FakeBroadcaster, FakeMailer, FakeQueue, FakeSession, FakeCookieJar, FakeLogger, FakeConfigRepository, FakeAuthenticatable, FakeUserProvider, FakeGuard, FakeHttpClient, FakeEncryptor, FakeClock, FakeSleeper, FakeConfirmationPrompter

Usage

FakeEventDispatcher

FakeMailer

FakeQueue

FakeSession

FakeCookieJar

FakeLogger

FakeConfigRepository

FakeAuthenticatable

FakeUserProvider

FakeGuard

FakeHttpClient

FakeEncryptor

KnownDriversValidator

API Reference

TestCase

FakeEventDispatcher

FakeMailer

FakeQueue

FakeLogger

FakeGuard

FakeHttpClient

TestClient

TestDatabase, RefreshDatabase, TruncateDatabase

TestResponse

KnownDriversValidator

Pest Expectations

marko/testing ships Pest custom expectations. They register automatically through a Pest plugin (extra.pest.plugins), so Pest.php needs no require. Pest 4 is required for the expectations; the fakes and their assert*() methods work without it.

Documentation

Full usage, API reference, and examples: marko/testing


All versions of testing with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
marko/core Version self.version
marko/cache Version self.version
marko/clock Version self.version
marko/broadcasting Version self.version
marko/config Version self.version
marko/encryption Version self.version
marko/filesystem Version self.version
marko/mail Version self.version
marko/notification Version self.version
marko/queue Version self.version
marko/session Version self.version
marko/log Version self.version
marko/authentication Version self.version
marko/http Version self.version
marko/routing Version self.version
marko/validation Version self.version
psr/clock Version ^1.0
ext-fileinfo Version *
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 marko/testing contains the following files

Loading the files please wait ...