Tests - implement BaseTestCase::assert*() methods to verify constructors

This commit is contained in:
Meritoo
2017-09-22 19:22:08 +02:00
parent 2dc215a3e4
commit d0badf1ec6
12 changed files with 57 additions and 19 deletions

View File

@@ -8,10 +8,10 @@
namespace Meritoo\LimeSurvey\Test\ApiClient\Result\Item;
use Meritoo\Common\Test\Base\BaseTestCase;
use Meritoo\LimeSurvey\ApiClient\Result\Item\ParticipantShort;
use Meritoo\LimeSurvey\ApiClient\Result\Processor\ResultProcessor;
use Meritoo\LimeSurvey\ApiClient\Type\MethodType;
use PHPUnit_Framework_TestCase;
/**
* Test case of the one item of the result/data: short data of participant
@@ -19,7 +19,7 @@ use PHPUnit_Framework_TestCase;
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
*/
class ParticipantShortTest extends PHPUnit_Framework_TestCase
class ParticipantShortTest extends BaseTestCase
{
/**
* Raw data of participants
@@ -42,6 +42,11 @@ class ParticipantShortTest extends PHPUnit_Framework_TestCase
*/
private $participant2ndInstance;
public function testConstructorVisibilityAndArguments()
{
static::assertHasNoConstructor(ParticipantShort::class);
}
public function testCreateOfTheParticipant()
{
$processor = new ResultProcessor();

View File

@@ -9,10 +9,10 @@
namespace Meritoo\LimeSurvey\Test\ApiClient\Result\Item;
use DateTime;
use Meritoo\Common\Test\Base\BaseTestCase;
use Meritoo\LimeSurvey\ApiClient\Result\Item\Participant;
use Meritoo\LimeSurvey\ApiClient\Result\Processor\ResultProcessor;
use Meritoo\LimeSurvey\ApiClient\Type\MethodType;
use PHPUnit_Framework_TestCase;
/**
* Test case of the one item of the result/data: full data of participant
@@ -20,7 +20,7 @@ use PHPUnit_Framework_TestCase;
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
*/
class ParticipantTest extends PHPUnit_Framework_TestCase
class ParticipantTest extends BaseTestCase
{
/**
* Raw data of participants
@@ -43,6 +43,11 @@ class ParticipantTest extends PHPUnit_Framework_TestCase
*/
private $participant2ndInstance;
public function testConstructorVisibilityAndArguments()
{
static::assertHasNoConstructor(Participant::class);
}
public function testCreateOfTheParticipant()
{
$processor = new ResultProcessor();

View File

@@ -42,6 +42,11 @@ class QuestionShortTest extends BaseTestCase
*/
private $question2ndInstance;
public function testConstructorVisibilityAndArguments()
{
static::assertHasNoConstructor(QuestionShort::class);
}
public function testCreateOfTheQuestionShort()
{
$processor = new ResultProcessor();

View File

@@ -8,10 +8,10 @@
namespace Meritoo\LimeSurvey\Test\ApiClient\Result\Item;
use Meritoo\Common\Test\Base\BaseTestCase;
use Meritoo\LimeSurvey\ApiClient\Result\Item\Question;
use Meritoo\LimeSurvey\ApiClient\Result\Processor\ResultProcessor;
use Meritoo\LimeSurvey\ApiClient\Type\MethodType;
use PHPUnit_Framework_TestCase;
/**
* Test case of the one item of the result/data: full data of one question of survey
@@ -19,7 +19,7 @@ use PHPUnit_Framework_TestCase;
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
*/
class QuestionTest extends PHPUnit_Framework_TestCase
class QuestionTest extends BaseTestCase
{
/**
* Raw data of questions
@@ -42,6 +42,11 @@ class QuestionTest extends PHPUnit_Framework_TestCase
*/
private $question2ndInstance;
public function testConstructorVisibilityAndArguments()
{
static::assertHasNoConstructor(Question::class);
}
public function testCreateOfTheQuestionShort()
{
$processor = new ResultProcessor();

View File

@@ -9,10 +9,10 @@
namespace Meritoo\LimeSurvey\Test\ApiClient\Result\Item;
use DateTime;
use Meritoo\Common\Test\Base\BaseTestCase;
use Meritoo\LimeSurvey\ApiClient\Result\Item\Survey;
use Meritoo\LimeSurvey\ApiClient\Result\Processor\ResultProcessor;
use Meritoo\LimeSurvey\ApiClient\Type\MethodType;
use PHPUnit_Framework_TestCase;
/**
* Test case of the one item of the result/data: survey
@@ -20,7 +20,7 @@ use PHPUnit_Framework_TestCase;
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
* @copyright Meritoo.pl
*/
class SurveyTest extends PHPUnit_Framework_TestCase
class SurveyTest extends BaseTestCase
{
/**
* Raw data of surveys
@@ -43,6 +43,11 @@ class SurveyTest extends PHPUnit_Framework_TestCase
*/
private $survey2ndInstance;
public function testConstructorVisibilityAndArguments()
{
static::assertHasNoConstructor(Survey::class);
}
public function testCreateOfTheSurvey()
{
$processor = new ResultProcessor();