<?php
namespace UnitTestFiles\Test;
use PHPUnit\Framework\TestCase;

class FirstTest extends TestCase
{
    /**
     * @dataProvider additionProvider
     */
    public function testAdd($val, $expected)
    {
        $match_val = $val;
        $random = substr(md5(mt_rand()), 0, 7);
        $input_code = '<?php 
        $user_input = "' . $val . '";';
        $filePath = "temp/unit_" . $random. ".php";
        $unitTestfilePath = "temp/test1.php";
        $code = file_get_contents($unitTestfilePath);
        $programFile = fopen($filePath, "w");
        fwrite($programFile, $input_code . $code);
        fclose($programFile);
        $get = require($filePath);
        $this->expectOutputString($expected);
        // shell_exec("del ".$filePath." ");
        // $this->assertEquals($expected, $match_val);
    }

    public function additionProvider()
    {
        return [
            ["1 1 1", 3],
            ["15 15", 30],
            ["25 25", 50],
        ];
    }
}

?>