{"id":22764599,"url":"https://github.com/kuria/phpunit-extras","last_synced_at":"2026-05-15T08:35:22.246Z","repository":{"id":57009942,"uuid":"149038442","full_name":"kuria/phpunit-extras","owner":"kuria","description":"Additional functionality for PHPUnit (such as assertions)","archived":false,"fork":false,"pushed_at":"2023-04-22T14:38:44.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-13T05:46:26.939Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kuria.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-16T21:44:28.000Z","updated_at":"2023-09-19T17:45:29.000Z","dependencies_parsed_at":"2024-11-21T08:45:30.639Z","dependency_job_id":"783a30c1-b108-4771-9e23-80ee200e214a","html_url":"https://github.com/kuria/phpunit-extras","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"fca02d4d6af28d98d312a0830d876293397ce611"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/kuria/phpunit-extras","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuria%2Fphpunit-extras","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuria%2Fphpunit-extras/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuria%2Fphpunit-extras/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuria%2Fphpunit-extras/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kuria","download_url":"https://codeload.github.com/kuria/phpunit-extras/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuria%2Fphpunit-extras/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279012800,"owners_count":26085187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-11T12:09:28.122Z","updated_at":"2025-10-12T20:35:02.000Z","avatar_url":"https://github.com/kuria.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"PHPUnit extras\n##############\n\nAdditional functionality for PHPUnit (such as assertions).\n\n.. image:: https://travis-ci.com/kuria/phpunit-extras.svg?branch=master\n    :target: https://travis-ci.com/kuria/phpunit-extras\n\n.. contents::\n\n\nRequirements\n************\n\n- PHP 7.1+\n\n\nUsage\n*****\n\n``AssertionTrait``\n==================\n\nThis trait exposes additional assertion methods to your test case.\n\n.. code:: php\n\n   \u003c?php\n\n   namespace Acme;\n\n   use Kuria\\PhpUnitExtras\\Traits\\AssertionTrait;\n   use PHPUnit\\Framework\\TestCase;\n\n   class ExampleTest extends TestCase\n   {\n       use AssertionTrait;\n\n       function testFooBar()\n       {\n           $this-\u003eassertEqualIterable([1, 2, 3], new \\ArrayObject([1, 2, 3]));\n       }\n   }\n\n\n``assertLooselyIdentical($expected, $actual, $canonicalizeKeys = false)``\n-------------------------------------------------------------------------\n\nAssert that two values have the same type and value, but consider different\ninstances of the same class identical as long as they have identical properties.\n\nIf ``$canonicalizeKeys = TRUE``, then array key order is ignored.\n\n\n``assertSameIterable(iterable $expected, $actual)``\n---------------------------------------------------\n\nAssert that two iterables contain the same values and types in the same order\n\nTypes are compared the same way as with the ``===`` operator.\n\n\n``assertLooselyIdenticalIterable(iterable $expected, $actual, $canonicalizeKeys = false)``\n------------------------------------------------------------------------------------------\n\nAssert that two iterables contain the same values and types in the same order,\nbut consider different instances of the same class identical as long as they\nhave identical properties.\n\nIf ``$canonicalizeKeys = TRUE``, then array key order is ignored.\n\n\n``assertEqualIterable(iterable $expected, $actual)``\n----------------------------------------------------\n\nAssert that two iterables contain equal values in any order\n\nTypes are compared the same way as with the ``==`` operator.\n\n\n``looselyIdenticalTo($value, $canonicalizeKeys = false)``\n---------------------------------------------------------\n\nCreate the ``IsLooselyIdentical`` constraint. See ``assertLooselyIdentical()``.\n\n\n``identicalIterable(iterable $expected)``\n-----------------------------------------\n\nCreate the ``IsIdenticalIterable`` constraint. See ``assertSameIterable()``.\n\n\n``looselyIdenticalIterable(iterable $expected, $canonicalizeKeys = false)``\n---------------------------------------------------------------------------\n\nCreate the ``IsLooselyIdenticalIterable`` constraint. See ``assertLooselyIdenticalIterable()``.\n\n\n``equalIterable(iterable $expected)``\n-------------------------------------\n\nCreate the ``IsEqualIterable`` constraint. See ``assertEqualIterable()``.\n\n\n``ClockTrait``\n==============\n\nMock current time in tests.\n\nOnly affects code that uses the `kuria/clock \u003chttps://github.com/kuria/clock\u003e`_ component.\n\n.. code:: php\n\n   \u003c?php\n\n   namespace Acme;\n\n   use Kuria\\PhpUnitExtras\\Traits\\ClockTrait;\n   use PHPUnit\\Framework\\TestCase;\n\n   class ExampleTest extends TestCase\n   {\n       use ClockTrait;\n\n       function testFooBar()\n       {\n           $this-\u003eatTime(1535904500, function () {\n               // some code that uses Kuria/Clock/Clock\n           });\n       }\n   }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuria%2Fphpunit-extras","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkuria%2Fphpunit-extras","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuria%2Fphpunit-extras/lists"}