mirror of
https://github.com/wiosna-dev/limesurvey-api-client.git
synced 2026-03-12 10:11:49 +01:00
Minor refactoring
This commit is contained in:
@@ -17,7 +17,7 @@ use Meritoo\LimeSurvey\ApiClient\Result\Item\Participant;
|
||||
use Meritoo\LimeSurvey\ApiClient\Result\Item\ParticipantShort;
|
||||
|
||||
/**
|
||||
* Test case of the collection of participants (of surveys)
|
||||
* Test case of the collection of participants' short data
|
||||
*
|
||||
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
|
||||
* @copyright Meritoo.pl
|
||||
@@ -25,7 +25,7 @@ use Meritoo\LimeSurvey\ApiClient\Result\Item\ParticipantShort;
|
||||
class ParticipantsTest extends BaseTestCase
|
||||
{
|
||||
/**
|
||||
* An empty collection of participants (of surveys)
|
||||
* An empty collection of participants' short data
|
||||
*
|
||||
* @var Participants
|
||||
*/
|
||||
|
||||
@@ -127,12 +127,24 @@ class ParticipantShortTest extends BaseTestCase
|
||||
static::assertEquals($participant2->getEmail(), $participantShort2->getEmail());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->rawData = static::getParticipantsRawData();
|
||||
|
||||
$this->participant1stInstance = new ParticipantShort($this->rawData[0]);
|
||||
$this->participant2ndInstance = new ParticipantShort($this->rawData[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns raw data of participants
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getParticipantsRawData()
|
||||
private static function getParticipantsRawData()
|
||||
{
|
||||
return [
|
||||
[
|
||||
@@ -153,16 +165,4 @@ class ParticipantShortTest extends BaseTestCase
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->rawData = static::getParticipantsRawData();
|
||||
|
||||
$this->participant1stInstance = new ParticipantShort($this->rawData[0]);
|
||||
$this->participant2ndInstance = new ParticipantShort($this->rawData[1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,12 +159,24 @@ class ParticipantTest extends BaseTestCase
|
||||
static::assertNull($this->participant2ndInstance->getValidUntil());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->rawData = static::getParticipantsRawData();
|
||||
|
||||
$this->participant1stInstance = new Participant($this->rawData[0]);
|
||||
$this->participant2ndInstance = new Participant($this->rawData[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns raw data of participants
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getParticipantsRawData()
|
||||
private static function getParticipantsRawData()
|
||||
{
|
||||
return [
|
||||
[
|
||||
@@ -207,16 +219,4 @@ class ParticipantTest extends BaseTestCase
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->rawData = static::getParticipantsRawData();
|
||||
|
||||
$this->participant1stInstance = new Participant($this->rawData[0]);
|
||||
$this->participant2ndInstance = new Participant($this->rawData[1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,12 +158,24 @@ class QuestionShortTest extends BaseTestCase
|
||||
static::assertEquals('HR', $this->question2ndInstance->getModuleName());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->rawData = static::getQuestionsRawData();
|
||||
|
||||
$this->question1stInstance = new QuestionShort($this->rawData[0]);
|
||||
$this->question2ndInstance = new QuestionShort($this->rawData[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns raw data of questions
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getQuestionsRawData()
|
||||
private static function getQuestionsRawData()
|
||||
{
|
||||
return [
|
||||
[
|
||||
@@ -214,16 +226,4 @@ class QuestionShortTest extends BaseTestCase
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->rawData = static::getQuestionsRawData();
|
||||
|
||||
$this->question1stInstance = new QuestionShort($this->rawData[0]);
|
||||
$this->question2ndInstance = new QuestionShort($this->rawData[1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,12 +194,24 @@ class QuestionTest extends BaseTestCase
|
||||
static::assertNull($this->question2ndInstance->getDefaultValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->rawData = static::getQuestionsRawData();
|
||||
|
||||
$this->question1stInstance = new Question($this->rawData[0]);
|
||||
$this->question2ndInstance = new Question($this->rawData[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns raw data of questions
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getQuestionsRawData()
|
||||
private static function getQuestionsRawData()
|
||||
{
|
||||
return [
|
||||
[
|
||||
@@ -276,16 +288,4 @@ class QuestionTest extends BaseTestCase
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->rawData = static::getQuestionsRawData();
|
||||
|
||||
$this->question1stInstance = new Question($this->rawData[0]);
|
||||
$this->question2ndInstance = new Question($this->rawData[1]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user