mirror of
https://github.com/wiosna-dev/limesurvey-api-client.git
synced 2026-03-12 10:11:49 +01:00
Tests - use common method to create/prepare date
This commit is contained in:
@@ -14,6 +14,7 @@ use Meritoo\Common\Type\OopVisibilityType;
|
||||
use Meritoo\LimeSurvey\ApiClient\Result\Item\Participant;
|
||||
use Meritoo\LimeSurvey\ApiClient\Result\Processor\ResultProcessor;
|
||||
use Meritoo\LimeSurvey\ApiClient\Type\MethodType;
|
||||
use Meritoo\LimeSurvey\Test\ApiClient\Utilities\DateUtility;
|
||||
|
||||
/**
|
||||
* Test case of the one item of the result/data: full data of participant
|
||||
@@ -196,7 +197,7 @@ class ParticipantTest extends BaseTestCase
|
||||
'completed' => 'N',
|
||||
'usesleft' => 10,
|
||||
'validfrom' => null,
|
||||
'validuntil' => (new DateTime())->format('Y-m-d H:i:s'),
|
||||
'validuntil' => DateUtility::getDateTime(),
|
||||
],
|
||||
[
|
||||
'tid' => '456',
|
||||
@@ -212,9 +213,9 @@ class ParticipantTest extends BaseTestCase
|
||||
'sent' => 'Y',
|
||||
'remindersent' => 'N',
|
||||
'remindercount' => 1,
|
||||
'completed' => (new DateTime())->format('Y-m-d H:i'),
|
||||
'completed' => DateUtility::getDateTime(false),
|
||||
'usesleft' => 5,
|
||||
'validfrom' => (new DateTime())->format('Y-m-d H:i:s'),
|
||||
'validfrom' => DateUtility::getDateTime(),
|
||||
'validuntil' => null,
|
||||
],
|
||||
];
|
||||
|
||||
@@ -14,6 +14,7 @@ use Meritoo\Common\Type\OopVisibilityType;
|
||||
use Meritoo\LimeSurvey\ApiClient\Result\Item\Survey;
|
||||
use Meritoo\LimeSurvey\ApiClient\Result\Processor\ResultProcessor;
|
||||
use Meritoo\LimeSurvey\ApiClient\Type\MethodType;
|
||||
use Meritoo\LimeSurvey\Test\ApiClient\Utilities\DateUtility;
|
||||
|
||||
/**
|
||||
* Test case of the one item of the result/data: survey
|
||||
@@ -99,13 +100,13 @@ class SurveyTest extends BaseTestCase
|
||||
'sid' => '123',
|
||||
'surveyls_title' => 'Test',
|
||||
'startdate' => null,
|
||||
'expires' => (new DateTime())->format('Y-m-d H:i:s'),
|
||||
'expires' => DateUtility::getDateTime(),
|
||||
'active' => 'N',
|
||||
],
|
||||
[
|
||||
'sid' => '456',
|
||||
'surveyls_title' => 'Another Test',
|
||||
'startdate' => (new DateTime())->format('Y-m-d H:i:s'),
|
||||
'startdate' => DateUtility::getDateTime(),
|
||||
'expires' => null,
|
||||
'active' => 'Y',
|
||||
],
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
|
||||
namespace Meritoo\LimeSurvey\Test\ApiClient\Result\Result;
|
||||
|
||||
use DateTime;
|
||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||
use Meritoo\Common\Type\OopVisibilityType;
|
||||
use Meritoo\LimeSurvey\ApiClient\Base\Result\BaseItem;
|
||||
use Meritoo\LimeSurvey\ApiClient\Exception\CannotProcessDataException;
|
||||
use Meritoo\LimeSurvey\ApiClient\Result\Result;
|
||||
use Meritoo\LimeSurvey\ApiClient\Type\MethodType;
|
||||
use Meritoo\LimeSurvey\Test\ApiClient\Utilities\DateUtility;
|
||||
use PHPUnit_Framework_MockObject_MockObject;
|
||||
|
||||
/**
|
||||
@@ -179,7 +179,7 @@ class ResultTest extends BaseTestCase
|
||||
[
|
||||
'sid' => '456',
|
||||
'surveyls_title' => 'Another Test',
|
||||
'startdate' => (new DateTime())->format('Y-m-d H:i:s'),
|
||||
'startdate' => DateUtility::getDateTime(),
|
||||
'expires' => null,
|
||||
'active' => 'Y',
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user