Adding ProcessMaker\Util\Common class utility and unit test
This commit is contained in:
37
workflow/engine/src/Tests/ProcessMaker/Util/CommonTest.php
Normal file
37
workflow/engine/src/Tests/ProcessMaker/Util/CommonTest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
namespace Tests\ProcessMaker\Util;
|
||||
|
||||
|
||||
use ProcessMaker\Util;
|
||||
|
||||
/**
|
||||
* Class XmlExporterTest
|
||||
*
|
||||
* @package Tests\ProcessMaker\Project
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class XmlExporterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
function testGetLastVersion()
|
||||
{
|
||||
$lastVer = Util\Common::getLastVersion(__DIR__."/../../fixtures/files_struct/first/sample-*.txt");
|
||||
$this->assertEquals(3, $lastVer);
|
||||
}
|
||||
|
||||
function testGetLastVersionSec()
|
||||
{
|
||||
$lastVer = Util\Common::getLastVersion(__DIR__."/../../fixtures/files_struct/second/sample-*.txt");
|
||||
|
||||
$this->assertEquals(5, $lastVer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Negative test, no matched files found
|
||||
*/
|
||||
function testGetLastVersionThr()
|
||||
{
|
||||
$lastVer = Util\Common::getLastVersion(sys_get_temp_dir()."/sample-*.txt");
|
||||
|
||||
$this->assertEquals(0, $lastVer);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user