PHP code example of lomouty / mock

1. Go to this page and download the library: Download lomouty/mock 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/ */

    

lomouty / mock example snippets


$template = array(
    'number|1-10.1-4' => 1,
    'string|5-20' => '*',
    'boolean|1' => true,
    'object|2-4' => array(
        'test1' => 'abc',
        'test2' => 'def',
        'test3' => 'fggs',
        'test4' => 'gddee',
        'test5' => 'blockkid',
    ),
    'array|1-3' => array(
        'test',
        123,
        false,
        array(
            'tmp1' => 12,
            'tmp2' => 34,
        ),
    ),
);

$res = \Lomouty\Mock\Mock::mock($template);

Array
(
    [number] => 6
    [string] => **********
    [boolean] => 
    [object] => Array
        (
            [test3] => fggs
            [test5] => blockkid
            [test4] => gddee
        )

    [array] => Array
        (
            [0] => test
            [1] => 123
            [2] => 
            [3] => Array
                (
                    [tmp1] => 23
                    [tmp3] => 23
                    [tmp4] => 23
                )

            [4] => 233.3455
            [5] => vtest
        )

)