PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 3.1.0
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v3.1.0
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
bit-form / vendor / arif-un / jcof / tests / Unit / ExampleTest.php

ExampleTest.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 3.1.0, at vendor/arif-un/jcof/tests/Unit/ExampleTest.php

57 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use Jcof\Jcof;
4
5 function covertAndRevertJson($jsonString)
6 {
7 $data = json_decode($jsonString, true);
8
9 $jcofCompressed = Jcof::stringify($data);
10
11 $jcofCompressedToArray = Jcof::parse($jcofCompressed);
12
13 expect(($data))->toEqual(($jcofCompressedToArray));
14 }
15
16 test('example 1', function () {
17 $jsonString = file_get_contents(__DIR__.'/../data/circuitsim.json');
18
19 covertAndRevertJson($jsonString);
20 });
21
22 test('example 2', function () {
23 $jsonString = file_get_contents(__DIR__.'/../data/madrid.json');
24
25 covertAndRevertJson($jsonString);
26 });
27
28 test('example 3', function () {
29 $jsonString = file_get_contents(__DIR__.'/../data/comets.json');
30
31 covertAndRevertJson($jsonString);
32 });
33
34 test('example 4', function () {
35 $jsonString = file_get_contents(__DIR__.'/../data/meteorites.json');
36
37 covertAndRevertJson($jsonString);
38 });
39
40 test('example 5', function () {
41 $jsonString = file_get_contents(__DIR__.'/../data/pokedex.json');
42
43 covertAndRevertJson($jsonString);
44 });
45
46 test('example 6', function () {
47 $jsonString = file_get_contents(__DIR__.'/../data/pokemon.json');
48
49 covertAndRevertJson($jsonString);
50 });
51
52 test('example 7', function () {
53 $jsonString = file_get_contents(__DIR__.'/../data/tiny.json');
54
55 covertAndRevertJson($jsonString);
56 });
57