PHP code example of jehoshua02 / json-files

1. Go to this page and download the library: Download jehoshua02/json-files library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jehoshua02 / json-files example snippets




use \Stoutie\JsonFiles; /* [1] */

class SomeClassTest extends PHPUnit_Framework_TestCase
{
    /**
     * @dataProvider someMethodDataProvider
     */
    public function testSomeMethod(/* ... args ... */)
    {
        /* ... test ... */
    }

    public function someMethodDataProvider()
    {
        return new JsonFiles\Iterator(__FILE__); /* [2] */
    }
}



$jsonLoader = new JsonFiles\Loader(__FILE__);
$data = $jsonLoader->load('someMethod/simple');

+ SomeClass.php
+ SomeClass.test.php
+ SomeClass.test.data/
|--+ someMethod/
|----+ simple.json
|----+ complex.json