Multiple fixes

* Implemented ScriptRunner with environment expansion and cleaner
  code.
* Added ApiClient plugin (com.noccy.apiclient)
* Renamed CHANGELOG.md to VERSIONS.md
* Shuffled buildtools
* Added first unittests
This commit is contained in:
2021-12-11 01:44:01 +01:00
parent 8c6f7c1e93
commit 8cc1eac7a4
33 changed files with 1976 additions and 891 deletions

View File

@ -0,0 +1,30 @@
<?php
namespace Spark\Environment;
class ScriptRunnerTest extends \PhpUnit\Framework\TestCase
{
/**
* @dataProvider stringExpansionData
* @covers ScriptRunner::expandString
*/
public function testStringExpansion($source, $expect)
{
$runner = new ScriptRunner();
$expanded = $runner->expandString($source);
return $this->assertEquals($expect, $expanded);
}
public function stringExpansionData()
{
return [
[ 'Hello World!', 'Hello World!' ],
[ '${testenv}', '' ],
[ '${PATH}', getenv("PATH") ],
[ 'Greetings ${USER}', 'Greetings '.getenv("USER") ],
];
}
}