<commit_before><?php

error_reporting (-1); // displays all errors possible

// this shouldn't be done this way but it's just an example
ini_set ('display_errors', true); 

// DIRECTORY_SEPARATOR should be used
// but it's beyond this example...
require_once __DIR__ . '/lib/mput.php'; 

$tester = Mput::create ('Sample Test Suite');

$tester->setCallback (Mput::TEST_CASE_BEFORE, function ($tester)
{
    $tester->data ()->info = 'foobar';
});

$tester->createTestCase ('First Test Case', function ($tester)
{
    // everything here will pass (just an example)
    
    $tester->assertEquals ($tester->data ()->info, 'foobar', 'passed');
    
    $tester->assertSame (42, 42, 'passed');
    
    $tester->assertTrue (true, 'passed');
    
    $tester->pass ('passed');
});

$tester->createTestCase ('Second Test Case', function ($tester)
{
    // everything here will fail (just an example)
    
    $tester->assertNotEquals (true, true, 'failed');
    
    $tester->assertNotSame (42, 42, 'failed');
    
    $tester->assertFalse (true, 'failed');
    
    $tester->fail ('failed');
});


$tester->run ();<commit_msg>time to write a real example<commit_after><?php

error_reporting (-1); // displays all errors possible

// this shouldn't be done this way but it's just an example
ini_set ('display_errors', true); 

require_once __DIR__ . '/lib/mput.php'; 

require_once __DIR__ . '/example/calculator.php';

// -----------------------------------------------------------------------

$tester = Mput::create ('Calculator Test Suite');

$tester->setCallback (Mput::TEST_CASE_BEFORE, function ($tester)
{
    $tester->data ()->calculator = new Calculator ();
});

$tester->createTestCase ('Testing add ()', function ($tester)
{

});

$tester->createTestCase ('Testing subtract ()', function ($tester)
{

});

$tester->createTestCase ('Testing divide ()', function ($tester)
{
    
});

$tester->createTestCase ('Testing multiply ()', function ($tester)
{
    
});

// -------------------------------------------------------------------------

$tester->run ();
{'fraction_non_alphanumeric': 0.23398058252427184, 'fraction_numerical': 0.0048543689320388345, 'mean_word_length': 2.8379888268156424, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1485617', 'n_tokens_mistral': 646, 'n_tokens_neox': 617, 'n_words': 165}