PHP Package: spatie/phpunit-snapshot-assertions

PHPUnit Snapshot Assertions is a PHP library by spatie for snapshot testing assertions in PHPUnit, enhancing test coverage and reliability.

Current Version: 5.1.8
Last Updated: 2025-02-10
PHP Requirement: ^8.1
Dependencies:
phpunit/phpunit
⚠️ To ensure full functionality, the above dependencies might be required.

Package Description

PHPUnit Snapshot Assertions is a versatile PHP library developed by spatie, offering snapshot testing capabilities in PHPUnit. This library boosts testing efficiency, enabling users to streamline their testing processes. By leveraging snapshot testing, developers can efficiently verify changes in complex data structures, ensuring robust test coverage and reliability. With PHPUnit Snapshot Assertions, users can simplify their testing workflows, enhance code quality, and ensure optimal software performance.

📦 Show all available classes🔗 View on GitHub

Download Latest Version: 5.2.0

Clock Coming soon

Previous Versions

Code Integration Example

Make sure to include the correct namespace and class paths for proper usage.

<?php
// Example from PHPlibraries.com
require_once 'libs/spatie/phpunit-snapshot-assertions/5.2.0/loader.php';
require_once 'libs/sebastianbergmann/phpunit/12.1.5/loader.php';

use Spatie\PHPUnitSnapshotAssertions\Snapshot;
use PHPUnit\Framework\TestCase;

$obj = new Snapshot();
echo '✅ Test OK: ' . get_class($obj);
?>

We aim to make using PHP packages easier without Composer. If something doesn't work, let us know — we'll fix it promptly.

Community Discussion

Ask questions, share tips, or report issues below.