Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phpunit Iterable Assertions Laravel Package

loophp/phpunit-iterable-assertions

PHPUnit helper assertions for iterables. Adds convenient, fluent checks for arrays and Traversables to simplify and clarify test expectations when working with generators, collections, and other iterable data sources.

View on GitHub
Deep Wiki
Context7

Latest Stable Version GitHub stars Total Downloads GitHub Workflow Status Type Coverage License Donate!

PHPUnit Iterable Assertions

Description

Provide new assertions for your tests using PHPUnit.

Features

  • assertIdenticalIterable
  • assertNotIdenticalIterable

Installation

composer require --dev loophp/phpunit-iterable-assertions

Usage

<?php

namespace tests;

use loophp\PhpUnitIterableAssertions\Traits\IterableAssertions;
use PHPUnit\Framework\TestCase;

final class MyTest extends TestCase
{
    use IterableAssertions;

    $expected = range('a', 'c');
    $actual = ['a' => 'a', 'b' => 'b', 'c' => 'c'];

    // This will fail: The keys are different.
    self::assertIdenticalIterable(
        $expected,
        $actual
    );

    // This will succeed: Both iterables are different.
    self::assertNotIdenticalIterable(
        $expected,
        $actual
    );
}

Documentation

Code quality, tests, benchmarks

Every time changes are introduced into the library, Github runs the tests.

The library has tests written with PHPunit. Feel free to check them out in the tests directory.

Before each commit, some inspections are executed with GrumPHP; run composer grumphp to check manually.

The quality of the tests is tested with Infection a PHP Mutation testing framework - run composer infection to try it.

Static analyzers are also controlling the code. PHPStan and PSalm are enabled to their maximum level.

Contributing

Feel free to contribute by sending pull requests. We are a usually very responsive team and we will help you going through your pull request from the beginning to the end.

For some reasons, if you can't contribute to the code and willing to help, sponsoring is a good, sound and safe way to show us some gratitude for the hours we invested in this package.

Sponsor me on Github and/or any of [the contributors][6].

Changelog

See CHANGELOG.md for a changelog based on git commits.

For more detailed changelogs, please check the release changelogs.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope