# bit-form/3.1.0/vendor/arif-un/jcof/tests/Unit/ExampleTest.php

Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator &amp; Custom Form Builder, version 3.1.0. 57 lines.

- Page: https://pluginprobe.com/plugins/bit-form/3.1.0/code/vendor/arif-un/jcof/tests/Unit/ExampleTest.php
- Raw: https://pluginprobe.com/plugins/bit-form/3.1.0/raw/vendor/arif-un/jcof/tests/Unit/ExampleTest.php
- Modified: 2023-11-19T11:00:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/bit-form/3.1.0/code/vendor/arif-un/jcof/tests/Unit/ExampleTest.php#L10-L20`.

```php
<?php

use Jcof\Jcof;

function covertAndRevertJson($jsonString)
{
    $data = json_decode($jsonString, true);

    $jcofCompressed = Jcof::stringify($data);

    $jcofCompressedToArray = Jcof::parse($jcofCompressed);

    expect(($data))->toEqual(($jcofCompressedToArray));
}

test('example 1', function () {
    $jsonString = file_get_contents(__DIR__.'/../data/circuitsim.json');

    covertAndRevertJson($jsonString);
});

test('example 2', function () {
    $jsonString = file_get_contents(__DIR__.'/../data/madrid.json');

    covertAndRevertJson($jsonString);
});

test('example 3', function () {
    $jsonString = file_get_contents(__DIR__.'/../data/comets.json');

    covertAndRevertJson($jsonString);
});

test('example 4', function () {
    $jsonString = file_get_contents(__DIR__.'/../data/meteorites.json');

    covertAndRevertJson($jsonString);
});

test('example 5', function () {
    $jsonString = file_get_contents(__DIR__.'/../data/pokedex.json');

    covertAndRevertJson($jsonString);
});

test('example 6', function () {
    $jsonString = file_get_contents(__DIR__.'/../data/pokemon.json');

    covertAndRevertJson($jsonString);
});

test('example 7', function () {
    $jsonString = file_get_contents(__DIR__.'/../data/tiny.json');

    covertAndRevertJson($jsonString);
});

```
