Misc fixes
* Updated build scripts to handle gitless environments a little better * PDO shell plugin improvements * More tests
This commit is contained in:
@ -27,4 +27,32 @@ class ScriptRunnerTest extends \PhpUnit\Framework\TestCase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ScriptRunner::defineScript
|
||||
* @covers ScriptRunner::evalutateDefinedScript
|
||||
*/
|
||||
public function testDefiningAndCallingScript()
|
||||
{
|
||||
$runner = new ScriptRunner(true);
|
||||
$runner->defineScript('test1', __CLASS__."::call1");
|
||||
$runner->defineScript('test2', [ __CLASS__."::call2" ]);
|
||||
|
||||
$this->assertFalse(self::$call1);
|
||||
$runner->evaluateDefinedScript('test1');
|
||||
$this->assertTrue(self::$call1);
|
||||
|
||||
$this->assertFalse(self::$call2);
|
||||
$runner->evaluateDefinedScript('test2');
|
||||
$this->assertTrue(self::$call2);
|
||||
}
|
||||
|
||||
public static function call1()
|
||||
{ self::$call1 = true; }
|
||||
|
||||
public static function call2()
|
||||
{ self::$call2 = true; }
|
||||
|
||||
private static bool $call1 = false;
|
||||
private static bool $call2 = false;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user