PHP code example of corex / testing

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

    

corex / testing example snippets


$faker = TestData::faker();
$faker->...

// Get random number.
$number = TestData::number();

// Get random number between 10 and 20.
$number = TestData::number(10, 20);

// Get random string (alpha + numeric) 20 characters long.
$string = TestData::string();

// Get random string (alpha + numeric) 10 characters long.
$string = TestData::string(10);

// Get random string (alpha).
$string = TestData::stringAlpha();

// Get random string (alpha) 10 characters long (uppercase).
$string = TestData::stringAlpha(10, true);

// Get random string (numeric) 16 characters long (uppercase).
$string = TestData::stringNumeric(16, true);

// Get list of numbers from 10 to 20 as array.
$numbers = TestData::numbers(10, 20);

// Get 20 (default 10) people (id, firstname and lastname).
$people = TestData::people(20);