Search by

quire / testing

dpoposki

Test Quire extensions and themes: a minimal test application, a PHPUnit base class and helpers.

v0.1.2 2026-10-27 11:30 UTC

This package is auto-updated.

Last update: 2026-10-28 21:00:58 UTC


README

Tests for Quire extensions and themes: each test class runs a small Quire application with only the extensions it lists, against a test database, and every test is rolled back afterwards.

composer require --dev quire/testing
final class ReviewsTest extends Quire\Testing\ExtensionTestCase
{
    protected static array $extensions = ['acme-reviews'];

    public function testListsReviews(): void
    {
        $this->client->request('GET', '/reviews');

        self::assertResponseIsSuccessful();
    }
}

Helpers sign people in (signIn('editor')), create content in any state (content('post', 'Hello')->published()->create()) and changes waiting for review (changes($post)->submitted()->create()), and show what the audit log recorded during a test. AdminTestCase adds helpers for admin pages, and quire:demo:seed fills a site with a realistic demo, "Tournament News".

See testing your extension.

License: MIT.