PMCORE-3985 PHP Unit, solve the issue in the Circle CI

This commit is contained in:
Roly Gutierrez
2022-09-14 12:08:21 -04:00
parent f7112d18e9
commit cc36bbe277
12 changed files with 39 additions and 41 deletions

View File

@@ -11,11 +11,13 @@ class WorkspaceToolsTest extends TestCase
public $workspace;
/**
* Call the setUp parent method
* Set up method.
* @return void
*/
public function setUp()
public function setUp(): void
{
parent::setUp(); // TODO: Change the autogenerated stub
parent::setUp();
$this->truncateNonInitialModels();
config(["system.workspace" => "new_site"]);
$this->workspace = config("system.workspace");
@@ -31,26 +33,16 @@ class WorkspaceToolsTest extends TestCase
public function it_should_test_upgrade_Iso_Country_method()
{
$workspaceTools = new WorkspaceTools($this->workspace);
$workspaceTools->updateIsoCountry();
$workspaceTools->updateIsoCountry();
$result = ob_get_contents();
$this->assertRegExp("/-> Update table ISO_COUNTRY Done/", $result);
$this->assertMatchesRegularExpression("/-> Update table ISO_COUNTRY Done/", $result);
$res = IsoCountry::findById('CI');
// Assert the result is the expected
$this->assertEquals('Côte d\'Ivoire', $res['IC_NAME']);
}
/**
* Set up method.
* @return void
*/
public function setUp(): void
{
parent::setUp();
$this->truncateNonInitialModels();
}
/**
* Tests the migrateCaseTitleToThreads method
*
@@ -149,7 +141,7 @@ class WorkspaceToolsTest extends TestCase
$result = ob_get_contents();
ob_end_clean();
$this->assertMatchesRegularExpression("/The Case Title has been updated successfully in APP_DELEGATION table./", $result);
$r = Delegation::select('DEL_TITLE')->where('DELEGATION_ID', $delegation1->DELEGATION_ID)->get()->values()->toArray();
$this->assertEquals($r[0]['DEL_TITLE'], $application1->APP_TITLE);