PMC-913 All existing Unit Tests are running correctly
This commit is contained in:
@@ -62,9 +62,11 @@ class LanguageTest extends TestCase
|
|||||||
public function testGetLanguageList()
|
public function testGetLanguageList()
|
||||||
{
|
{
|
||||||
$list = $this->object->getLanguageList();
|
$list = $this->object->getLanguageList();
|
||||||
$this->assertCount(1, $list);
|
$expected = [
|
||||||
$this->assertEquals('en', $list[0]['LANG_ID']);
|
'LANG_ID' => 'en',
|
||||||
$this->assertEquals('English', $list[0]['LANG_NAME']);
|
'LANG_NAME' => 'English',
|
||||||
|
];
|
||||||
|
$this->assertContains($expected, $list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,14 +79,21 @@ class LanguageTest extends TestCase
|
|||||||
{
|
{
|
||||||
$this->installLanguage('es', __DIR__ . '/processmaker.es.po');
|
$this->installLanguage('es', __DIR__ . '/processmaker.es.po');
|
||||||
$list = $this->object->getLanguageList();
|
$list = $this->object->getLanguageList();
|
||||||
$this->assertCount(2, $list);
|
$english = [
|
||||||
$this->assertEquals('en', $list[0]['LANG_ID']);
|
'LANG_ID' => 'en',
|
||||||
$this->assertEquals('English', $list[0]['LANG_NAME']);
|
'LANG_NAME' => 'English',
|
||||||
$this->assertEquals('es-ES', $list[1]['LANG_ID']);
|
];
|
||||||
$this->assertEquals('Spanish (Spain)', $list[1]['LANG_NAME']);
|
$this->assertContains($english, $list);
|
||||||
|
|
||||||
|
$spanish = [
|
||||||
|
'LANG_ID' => 'es-ES',
|
||||||
|
'LANG_NAME' => 'Spanish (Spain)',
|
||||||
|
];
|
||||||
|
$this->assertContains($spanish, $list);
|
||||||
|
|
||||||
$this->uninstallLanguage('es', __DIR__ . '/processmaker.es.po');
|
$this->uninstallLanguage('es', __DIR__ . '/processmaker.es.po');
|
||||||
$list2 = $this->object->getLanguageList();
|
$list2 = $this->object->getLanguageList();
|
||||||
$this->assertCount(1, $list2);
|
$this->assertContains($english, $list2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -220,10 +220,10 @@ class DelegationTest extends TestCase
|
|||||||
// Create a new delegation, but for this specific user
|
// Create a new delegation, but for this specific user
|
||||||
factory(Delegation::class)->create([
|
factory(Delegation::class)->create([
|
||||||
'USR_UID' => $user->USR_UID,
|
'USR_UID' => $user->USR_UID,
|
||||||
'USR_ID' => $user->id
|
'USR_ID' => $user->USR_ID
|
||||||
]);
|
]);
|
||||||
// Now fetch results, and assume delegation count is 1 and the user points to our user
|
// Now fetch results, and assume delegation count is 1 and the user points to our user
|
||||||
$results = Delegation::search($user->id);
|
$results = Delegation::search($user->USR_ID);
|
||||||
$this->assertCount(1, $results['data']);
|
$this->assertCount(1, $results['data']);
|
||||||
$this->assertEquals('testcaseuser', $results['data'][0]['USRCR_USR_USERNAME']);
|
$this->assertEquals('testcaseuser', $results['data'][0]['USRCR_USR_USERNAME']);
|
||||||
}
|
}
|
||||||
@@ -644,7 +644,7 @@ class DelegationTest extends TestCase
|
|||||||
// Create a new delegation, but for this specific user
|
// Create a new delegation, but for this specific user
|
||||||
factory(Delegation::class)->create([
|
factory(Delegation::class)->create([
|
||||||
'USR_UID' => $user->USR_UID,
|
'USR_UID' => $user->USR_UID,
|
||||||
'USR_ID' => $user->id
|
'USR_ID' => $user->USR_ID
|
||||||
]);
|
]);
|
||||||
$user = factory(User::class)->create([
|
$user = factory(User::class)->create([
|
||||||
'USR_USERNAME' => 'paul',
|
'USR_USERNAME' => 'paul',
|
||||||
@@ -654,7 +654,7 @@ class DelegationTest extends TestCase
|
|||||||
// Create a new delegation, but for this specific user
|
// Create a new delegation, but for this specific user
|
||||||
factory(Delegation::class)->create([
|
factory(Delegation::class)->create([
|
||||||
'USR_UID' => $user->USR_UID,
|
'USR_UID' => $user->USR_UID,
|
||||||
'USR_ID' => $user->id
|
'USR_ID' => $user->USR_ID
|
||||||
]);
|
]);
|
||||||
// Now fetch results, and assume delegation count is 2 and the ordering ascending return Gary
|
// Now fetch results, and assume delegation count is 2 and the ordering ascending return Gary
|
||||||
$results = Delegation::search(null, 0, 25, null, null, null, 'ASC', 'APP_CURRENT_USER');
|
$results = Delegation::search(null, 0, 25, null, null, null, 'ASC', 'APP_CURRENT_USER');
|
||||||
|
|||||||
Reference in New Issue
Block a user