PHPackages                             barkermn01/unittest-josn-schema - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. barkermn01/unittest-josn-schema

ActiveLibrary[Testing &amp; Quality](/categories/testing)

barkermn01/unittest-josn-schema
===============================

Allows Unit testing of JSON-Schema's against a supplied JSON-Schema schema or an in-schema defined schema

1.1.0(8y ago)05Apache-2.0PHPPHP ^7.2

Since Apr 21Pushed 8y ago1 watchersCompare

[ Source](https://github.com/barkermn01/UnitTestJSONSchema)[ Packagist](https://packagist.org/packages/barkermn01/unittest-josn-schema)[ RSS](/packages/barkermn01-unittest-josn-schema/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

UnitTest-JSON-Schema
====================

[](#unittest-json-schema)

A simple and easy to use class to aid in the validation and testing of a JSON-schema.

How to Install
--------------

[](#how-to-install)

```
composer require "barkermn01/unittest-josn-schema"

```

How to use
----------

[](#how-to-use)

#### Sample draft-7 schema for validation

[](#sample-draft-7-schema-for-validation)

```
{
  "$schema":"http://json-schema.org/draft-07/schema",
  "properties":{
    "test":{
      "type":"string"
    }
  }
}

```

Package is released in the namespace `UnitTestJSONSchema;`

#### Supply a schema in test cases manually.

[](#supply-a-schema-in-test-cases-manually)

```
$SchemaName = "test.schema.json";
$schemaToTest = file_get_contents(__DIR__ . "/test.schema.json");

$tester = new SchemaTester;
$tester->DefineSchema("http://json-schema.org/draft-07/schema");
$tester->TestSchema($schemaToTest);
$this->assertFalse($tester->hasErrors(), "Schema '{$SchemaName}' failed vailidation: '".$tester->getErrors());
```

#### Allow a schema to define it's own schema to be validated against

[](#allow-a-schema-to-define-its-own-schema-to-be-validated-against)

```
$SchemaName = "test.schema.json";
$schemaToTest = file_get_contents(__DIR__ . "/test.schema.json");

$tester = new SchemaTester;
$tester->TestSchema($schemaToTest);
$this->assertFalse($tester->hasErrors(), "Schema '{$SchemaName}' failed vailidation: '".$tester->getErrors());
```

License
=======

[](#license)

Licensed under the Appache-2 license.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2942d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bf5ebefadfcbdbbcffd578d4b912b47fc8a7d0dbe1ced3141a685b5711858ffd?d=identicon)[barkermn01](/maintainers/barkermn01)

---

Top Contributors

[![barkermn01](https://avatars.githubusercontent.com/u/37368?v=4)](https://github.com/barkermn01 "barkermn01 (13 commits)")

### Embed Badge

![Health badge](/badges/barkermn01-unittest-josn-schema/health.svg)

```
[![Health](https://phpackages.com/badges/barkermn01-unittest-josn-schema/health.svg)](https://phpackages.com/packages/barkermn01-unittest-josn-schema)
```

###  Alternatives

[phpbench/phpbench

PHP Benchmarking Framework

2.0k13.0M627](/packages/phpbench-phpbench)[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2021.0M277](/packages/drupal-core-dev)[jasonmccreary/laravel-test-assertions

A set of helpful assertions when testing Laravel applications.

3513.9M32](/packages/jasonmccreary-laravel-test-assertions)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[typo3/testing-framework

The TYPO3 testing framework provides base classes for unit, functional and acceptance testing.

675.0M775](/packages/typo3-testing-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
