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.
Download marko/testing
More information about marko/testing
Files in marko/testing
Package testing
Short Description Testing utilities for the Marko framework - fakes, assertions, and Pest integration
License MIT
Informations about the package testing
marko/testing
Testing utilities for Marko---reusable fakes with built-in assertions that eliminate test boilerplate.
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
Available Fakes
FakeEventDispatcher, FakeMailer, FakeQueue, FakeSession, FakeCookieJar, FakeLogger, FakeConfigRepository, FakeAuthenticatable, FakeUserProvider, FakeGuard
Usage
FakeEventDispatcher
FakeMailer
FakeQueue
FakeSession
FakeCookieJar
FakeLogger
FakeConfigRepository
FakeAuthenticatable
FakeUserProvider
FakeGuard
API Reference
FakeEventDispatcher
dispatch($event): void— Record a dispatched eventdispatched(string $class): array— Return all dispatched events of a classassertDispatched(string $class): void— Assert an event was dispatchedassertNotDispatched(string $class): void— Assert an event was not dispatchedassertDispatchedCount(string $class, int $count): void— Assert exact dispatch count
FakeMailer
send($message): void— Record a sent messageassertSent(string $class): void— Assert a message was sentassertNothingSent(): void— Assert no messages were sentassertSentCount(string $class, int $count): void— Assert exact sent count
FakeQueue
push($job): void— Record a pushed jobassertPushed(string $class): void— Assert a job was pushedassertNotPushed(string $class): void— Assert a job was not pushedassertPushedCount(string $class, int $count): void— Assert exact pushed countassertNothingPushed(): void— Assert no jobs were pushed
FakeLogger
info(string $message): void,error(),warning(), etc. — Record log entriesassertLogged(string $message): void— Assert a message was loggedassertNothingLogged(): void— Assert nothing was logged
FakeGuard
new FakeGuard(string $name, bool $attemptResult)— Create guard;$attemptResultcontrols whatattempt()returnssetUser(?AuthenticatableInterface $user): void— Set the current authenticated userattempt(array $credentials): bool— Record credentials attempt and return configured resultlogin(AuthenticatableInterface $user): void— Log in a user directlylogout(): void— Clear current user and record logoutassertAuthenticated(): void— Assert a user is currently authenticatedassertGuest(): void— Assert no user is authenticatedassertAttempted(?callable $callback = null): void— Assert attempt() was called, optionally matching credentials via callbackassertNotAttempted(): void— Assert attempt() was never calledassertLoggedOut(): void— Assert logout() was called
Pest Expectations
marko/testing ships Pest custom expectations that are auto-loaded via autoload.files.
Documentation
Full usage, API reference, and examples: marko/testing
All versions of testing with dependencies
marko/core Version self.version
marko/config Version self.version
marko/mail Version self.version
marko/queue Version self.version
marko/session Version self.version
marko/log Version self.version
marko/authentication Version self.version