-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fixReviewersListing-757' into 'main'
Realiza ajustes na listagem de avaliadores See merge request softwares-pkp/plugins_ojs/reviewersControlReport!4
- Loading branch information
Showing
3 changed files
with
91 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
import('lib.pkp.tests.DatabaseTestCase'); | ||
import('lib.pkp.classes.user.User'); | ||
import('plugins.generic.reviewersControlReport.classes.ReviewersControlReportForm'); | ||
|
||
class ReviewersControlReportFormTest extends DatabaseTestCase | ||
{ | ||
private $reviewerId; | ||
private $locale = 'en_US'; | ||
private $givenName = 'Walter'; | ||
private $familyName = 'Salles'; | ||
private $username = 'walter.salles'; | ||
private $email = 'walter.salles@ancine.com.br'; | ||
private $affiliation = 'Agência Nacional do Cinema'; | ||
|
||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->reviewerId = $this->createUser(); | ||
} | ||
|
||
protected function getAffectedTables() | ||
{ | ||
return ['users', 'user_settings']; | ||
} | ||
|
||
private function createUser() | ||
{ | ||
$user = new User(); | ||
$user->setData('givenName', [$this->locale => $this->givenName]); | ||
$user->setData('familyName', [$this->locale => $this->familyName]); | ||
$user->setData('affiliation', [$this->locale => $this->affiliation]); | ||
$user->setData('email', $this->email); | ||
$user->setData('username', $this->username); | ||
$user->setData('password', $this->username); | ||
|
||
return DAORegistry::getDAO('UserDAO')->insertObject($user); | ||
} | ||
|
||
public function testGetsReviewerPersonalData() | ||
{ | ||
$form = new ReviewersControlReportForm(); | ||
|
||
$reviewerPersonalData = $form->getReviewerPersonalData($this->reviewerId); | ||
$emptyInterests = ''; | ||
$expectedPersonalData = [ | ||
$this->givenName . ' ' . $this->familyName, | ||
$this->email, | ||
$this->affiliation, | ||
$emptyInterests | ||
]; | ||
|
||
$this->assertEquals($expectedPersonalData, $reviewerPersonalData); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters