upgrade phpunit

This commit is contained in:
Dennis Eichhorn 2024-03-20 05:16:00 +00:00
parent 073421c919
commit 52c5e464f3
17 changed files with 92 additions and 201 deletions

View File

@ -37,10 +37,10 @@ use phpOMS\System\MimeType;
use phpOMS\Utils\TestUtils; use phpOMS\Utils\TestUtils;
/** /**
* @testdox Modules\QA\tests\Controller\ApiControllerTest: QA api controller
*
* @internal * @internal
*/ */
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\QA\Controller\ApiController::class)]
#[\PHPUnit\Framework\Attributes\TestDox('Modules\QA\tests\Controller\ApiControllerTest: QA api controller')]
final class ApiControllerTest extends \PHPUnit\Framework\TestCase final class ApiControllerTest extends \PHPUnit\Framework\TestCase
{ {
protected ApplicationAbstract $app; protected ApplicationAbstract $app;
@ -95,10 +95,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
TestUtils::setMember($this->module, 'app', $this->app); TestUtils::setMember($this->module, 'app', $this->app);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Controller\ApiController
* @group module
*/
public function testApiQAAppCreate() : void public function testApiQAAppCreate() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
@ -111,10 +108,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
self::assertGreaterThan(0, $response->getDataArray('')['response']->id); self::assertGreaterThan(0, $response->getDataArray('')['response']->id);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Controller\ApiController
* @group module
*/
public function testApiQAAppCreateInvalidData() : void public function testApiQAAppCreateInvalidData() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
@ -127,10 +121,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
self::assertEquals(RequestStatusCode::R_400, $response->header->status); self::assertEquals(RequestStatusCode::R_400, $response->header->status);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Controller\ApiController
* @group module
*/
public function testApiQAQuestionCreate() : void public function testApiQAQuestionCreate() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
@ -163,10 +154,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
self::assertGreaterThan(0, $response->getDataArray('')['response']->id); self::assertGreaterThan(0, $response->getDataArray('')['response']->id);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Controller\ApiController
* @group module
*/
public function testApiQAQuestionCreateInvalidData() : void public function testApiQAQuestionCreateInvalidData() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
@ -179,10 +167,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
self::assertEquals(RequestStatusCode::R_400, $response->header->status); self::assertEquals(RequestStatusCode::R_400, $response->header->status);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Controller\ApiController
* @group module
*/
public function testApiQAAnswerCreate() : void public function testApiQAAnswerCreate() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
@ -213,10 +198,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
self::assertGreaterThan(0, $response->getDataArray('')['response']->id); self::assertGreaterThan(0, $response->getDataArray('')['response']->id);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Controller\ApiController
* @group module
*/
public function testApiChangeAnsweredStatus() : void public function testApiChangeAnsweredStatus() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
@ -230,10 +212,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
self::assertGreaterThan(0, $response->getDataArray('')['response']->id); self::assertGreaterThan(0, $response->getDataArray('')['response']->id);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Controller\ApiController
* @group module
*/
public function testApiQAAnswerCreateInvalidData() : void public function testApiQAAnswerCreateInvalidData() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
@ -246,10 +225,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
self::assertEquals(RequestStatusCode::R_400, $response->header->status); self::assertEquals(RequestStatusCode::R_400, $response->header->status);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Controller\ApiController
* @group module
*/
public function testApiChangeQAQuestionVote() : void public function testApiChangeQAQuestionVote() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
@ -273,10 +249,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
self::assertGreaterThan(0, $response->getDataArray('')['response']->id); self::assertGreaterThan(0, $response->getDataArray('')['response']->id);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Controller\ApiController
* @group module
*/
public function testApiChangeQAQuestionVoteInvalidData() : void public function testApiChangeQAQuestionVoteInvalidData() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
@ -289,10 +262,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
self::assertEquals(RequestStatusCode::R_400, $response->header->status); self::assertEquals(RequestStatusCode::R_400, $response->header->status);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Controller\ApiController
* @group module
*/
public function testApiChangeQAAnswerVote() : void public function testApiChangeQAAnswerVote() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
@ -316,10 +286,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
self::assertGreaterThan(0, $response->getDataArray('')['response']->id); self::assertGreaterThan(0, $response->getDataArray('')['response']->id);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Controller\ApiController
* @group module
*/
public function testApiChangeQAAnswerVoteInvalidData() : void public function testApiChangeQAAnswerVoteInvalidData() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();

View File

@ -19,31 +19,23 @@ use Modules\QA\Models\NullQAAnswer;
/** /**
* @internal * @internal
*/ */
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\QA\Models\NullQAAnswer::class)]
final class NullQAAnswerTest extends \PHPUnit\Framework\TestCase final class NullQAAnswerTest extends \PHPUnit\Framework\TestCase
{ {
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\NullQAAnswer
* @group module
*/
public function testNull() : void public function testNull() : void
{ {
self::assertInstanceOf('\Modules\QA\Models\QAAnswer', new NullQAAnswer()); self::assertInstanceOf('\Modules\QA\Models\QAAnswer', new NullQAAnswer());
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\NullQAAnswer
* @group module
*/
public function testId() : void public function testId() : void
{ {
$null = new NullQAAnswer(2); $null = new NullQAAnswer(2);
self::assertEquals(2, $null->id); self::assertEquals(2, $null->id);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\NullQAAnswer
* @group module
*/
public function testJsonSerialize() : void public function testJsonSerialize() : void
{ {
$null = new NullQAAnswer(2); $null = new NullQAAnswer(2);

View File

@ -19,31 +19,23 @@ use Modules\QA\Models\NullQAAnswerVote;
/** /**
* @internal * @internal
*/ */
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\QA\Models\NullQAAnswerVote::class)]
final class NullQAAnswerVoteTest extends \PHPUnit\Framework\TestCase final class NullQAAnswerVoteTest extends \PHPUnit\Framework\TestCase
{ {
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\NullQAAnswerVote
* @group module
*/
public function testNull() : void public function testNull() : void
{ {
self::assertInstanceOf('\Modules\QA\Models\QAAnswerVote', new NullQAAnswerVote()); self::assertInstanceOf('\Modules\QA\Models\QAAnswerVote', new NullQAAnswerVote());
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\NullQAAnswerVote
* @group module
*/
public function testId() : void public function testId() : void
{ {
$null = new NullQAAnswerVote(2); $null = new NullQAAnswerVote(2);
self::assertEquals(2, $null->id); self::assertEquals(2, $null->id);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\NullQAAnswerVote
* @group module
*/
public function testJsonSerialize() : void public function testJsonSerialize() : void
{ {
$null = new NullQAAnswerVote(2); $null = new NullQAAnswerVote(2);

View File

@ -19,31 +19,23 @@ use Modules\QA\Models\NullQAApp;
/** /**
* @internal * @internal
*/ */
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\QA\Models\NullQAApp::class)]
final class NullQAAppTest extends \PHPUnit\Framework\TestCase final class NullQAAppTest extends \PHPUnit\Framework\TestCase
{ {
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\NullQAApp
* @group module
*/
public function testNull() : void public function testNull() : void
{ {
self::assertInstanceOf('\Modules\QA\Models\QAApp', new NullQAApp()); self::assertInstanceOf('\Modules\QA\Models\QAApp', new NullQAApp());
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\NullQAApp
* @group module
*/
public function testId() : void public function testId() : void
{ {
$null = new NullQAApp(2); $null = new NullQAApp(2);
self::assertEquals(2, $null->id); self::assertEquals(2, $null->id);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\NullQAApp
* @group module
*/
public function testJsonSerialize() : void public function testJsonSerialize() : void
{ {
$null = new NullQAApp(2); $null = new NullQAApp(2);

View File

@ -19,31 +19,23 @@ use Modules\QA\Models\NullQAQuestion;
/** /**
* @internal * @internal
*/ */
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\QA\Models\NullQAQuestion::class)]
final class NullQAQuestionTest extends \PHPUnit\Framework\TestCase final class NullQAQuestionTest extends \PHPUnit\Framework\TestCase
{ {
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\NullQAQuestion
* @group module
*/
public function testNull() : void public function testNull() : void
{ {
self::assertInstanceOf('\Modules\QA\Models\QAQuestion', new NullQAQuestion()); self::assertInstanceOf('\Modules\QA\Models\QAQuestion', new NullQAQuestion());
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\NullQAQuestion
* @group module
*/
public function testId() : void public function testId() : void
{ {
$null = new NullQAQuestion(2); $null = new NullQAQuestion(2);
self::assertEquals(2, $null->id); self::assertEquals(2, $null->id);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\NullQAQuestion
* @group module
*/
public function testJsonSerialize() : void public function testJsonSerialize() : void
{ {
$null = new NullQAQuestion(2); $null = new NullQAQuestion(2);

View File

@ -19,31 +19,23 @@ use Modules\QA\Models\NullQAQuestionVote;
/** /**
* @internal * @internal
*/ */
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\QA\Models\NullQAQuestionVote::class)]
final class NullQAQuestionVoteTest extends \PHPUnit\Framework\TestCase final class NullQAQuestionVoteTest extends \PHPUnit\Framework\TestCase
{ {
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\NullQAQuestionVote
* @group module
*/
public function testNull() : void public function testNull() : void
{ {
self::assertInstanceOf('\Modules\QA\Models\QAQuestionVote', new NullQAQuestionVote()); self::assertInstanceOf('\Modules\QA\Models\QAQuestionVote', new NullQAQuestionVote());
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\NullQAQuestionVote
* @group module
*/
public function testId() : void public function testId() : void
{ {
$null = new NullQAQuestionVote(2); $null = new NullQAQuestionVote(2);
self::assertEquals(2, $null->id); self::assertEquals(2, $null->id);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\NullQAQuestionVote
* @group module
*/
public function testJsonSerialize() : void public function testJsonSerialize() : void
{ {
$null = new NullQAQuestionVote(2); $null = new NullQAQuestionVote(2);

View File

@ -24,13 +24,11 @@ use Modules\QA\Models\QAAnswerStatus;
/** /**
* @internal * @internal
*/ */
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\QA\Models\QAAnswerMapper::class)]
final class QAAnswerMapperTest extends \PHPUnit\Framework\TestCase final class QAAnswerMapperTest extends \PHPUnit\Framework\TestCase
{ {
/** #[\PHPUnit\Framework\Attributes\DependsExternal('\Modules\QA\tests\Models\QAQuestionMapperTest', 'testCRUD')]
* @depends Modules\QA\tests\Models\QAQuestionMapperTest::testCRUD #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\QAAnswerMapper
* @group module
*/
public function testCRUD() : void public function testCRUD() : void
{ {
$answer = new QAAnswer(); $answer = new QAAnswer();

View File

@ -22,6 +22,7 @@ use Modules\QA\Models\QAAnswerVote;
/** /**
* @internal * @internal
*/ */
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\QA\Models\QAAnswer::class)]
final class QAAnswerTest extends \PHPUnit\Framework\TestCase final class QAAnswerTest extends \PHPUnit\Framework\TestCase
{ {
private QAAnswer $answer; private QAAnswer $answer;
@ -34,10 +35,7 @@ final class QAAnswerTest extends \PHPUnit\Framework\TestCase
$this->answer = new QAAnswer(); $this->answer = new QAAnswer();
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\QAAnswer
* @group module
*/
public function testDefault() : void public function testDefault() : void
{ {
self::assertEquals(0, $this->answer->id); self::assertEquals(0, $this->answer->id);
@ -53,10 +51,7 @@ final class QAAnswerTest extends \PHPUnit\Framework\TestCase
self::assertInstanceOf('\DateTimeImmutable', $this->answer->createdAt); self::assertInstanceOf('\DateTimeImmutable', $this->answer->createdAt);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\QAAnswer
* @group module
*/
public function testVoteInputOutput() : void public function testVoteInputOutput() : void
{ {
$vote = new QAAnswerVote(); $vote = new QAAnswerVote();
@ -69,10 +64,7 @@ final class QAAnswerTest extends \PHPUnit\Framework\TestCase
self::assertEquals(1, $this->answer->getAccountVoteScore(1)); self::assertEquals(1, $this->answer->getAccountVoteScore(1));
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\QAAnswer
* @group module
*/
public function testSerialize() : void public function testSerialize() : void
{ {
$this->answer->status = QAAnswerStatus::ACTIVE; $this->answer->status = QAAnswerStatus::ACTIVE;

View File

@ -21,13 +21,11 @@ use Modules\QA\Models\QAAnswerVoteMapper;
/** /**
* @internal * @internal
*/ */
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\QA\Models\QAAnswerVoteMapper::class)]
final class QAAnswerVoteMapperTest extends \PHPUnit\Framework\TestCase final class QAAnswerVoteMapperTest extends \PHPUnit\Framework\TestCase
{ {
/** #[\PHPUnit\Framework\Attributes\DependsExternal('\Modules\QA\tests\Models\QAAnswerMapperTest', 'testCRUD')]
* @depends Modules\QA\tests\Models\QAAnswerMapperTest::testCRUD #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\QAAnswerVoteMapper
* @group module
*/
public function testCRUD() : void public function testCRUD() : void
{ {
\Modules\Admin\tests\Helper::createAccounts(1); \Modules\Admin\tests\Helper::createAccounts(1);

View File

@ -19,6 +19,7 @@ use Modules\QA\Models\QAAnswerVote;
/** /**
* @internal * @internal
*/ */
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\QA\Models\QAAnswerVote::class)]
final class QAAnswerVoteTest extends \PHPUnit\Framework\TestCase final class QAAnswerVoteTest extends \PHPUnit\Framework\TestCase
{ {
private QAAnswerVote $vote; private QAAnswerVote $vote;
@ -31,10 +32,7 @@ final class QAAnswerVoteTest extends \PHPUnit\Framework\TestCase
$this->vote = new QAAnswerVote(); $this->vote = new QAAnswerVote();
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\QAAnswerVote
* @group module
*/
public function testDefault() : void public function testDefault() : void
{ {
self::assertEquals(0, $this->vote->id); self::assertEquals(0, $this->vote->id);

View File

@ -19,6 +19,7 @@ use Modules\QA\Models\QAApp;
/** /**
* @internal * @internal
*/ */
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\QA\Models\QAApp::class)]
final class QAAppTest extends \PHPUnit\Framework\TestCase final class QAAppTest extends \PHPUnit\Framework\TestCase
{ {
private QAApp $app; private QAApp $app;
@ -31,20 +32,14 @@ final class QAAppTest extends \PHPUnit\Framework\TestCase
$this->app = new QAApp(); $this->app = new QAApp();
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\QAApp
* @group module
*/
public function testDefault() : void public function testDefault() : void
{ {
self::assertEquals(0, $this->app->id); self::assertEquals(0, $this->app->id);
self::assertEquals('', $this->app->name); self::assertEquals('', $this->app->name);
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\QAApp
* @group module
*/
public function testSerialize() : void public function testSerialize() : void
{ {
$this->app->name = 'Test Title'; $this->app->name = 'Test Title';

View File

@ -19,13 +19,11 @@ use Modules\QA\Models\QAHelperMapper;
/** /**
* @internal * @internal
*/ */
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\QA\Models\QAHelperMapper::class)]
final class QAHelperMapperTest extends \PHPUnit\Framework\TestCase final class QAHelperMapperTest extends \PHPUnit\Framework\TestCase
{ {
/** #[\PHPUnit\Framework\Attributes\DependsExternal('\Modules\QA\tests\Models\QAAnswerVoteMapperTest', 'testCRUD')]
* @depends Modules\QA\tests\Models\QAAnswerVoteMapperTest::testCRUD #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\QAHelperMapper
* @group module
*/
public function testAccountScore() : void public function testAccountScore() : void
{ {
self::assertGreaterThan(0, QAHelperMapper::getAccountScore([1])[1]); self::assertGreaterThan(0, QAHelperMapper::getAccountScore([1])[1]);

View File

@ -23,12 +23,10 @@ use Modules\QA\Models\QAQuestionStatus;
/** /**
* @internal * @internal
*/ */
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\QA\Models\QAQuestionMapper::class)]
final class QAQuestionMapperTest extends \PHPUnit\Framework\TestCase final class QAQuestionMapperTest extends \PHPUnit\Framework\TestCase
{ {
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\QAQuestionMapper
* @group module
*/
public function testCRUD() : void public function testCRUD() : void
{ {
$question = new QAQuestion(); $question = new QAQuestion();

View File

@ -25,6 +25,7 @@ use phpOMS\Localization\ISO639x1Enum;
/** /**
* @internal * @internal
*/ */
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\QA\Models\QAQuestion::class)]
final class QAQuestionTest extends \PHPUnit\Framework\TestCase final class QAQuestionTest extends \PHPUnit\Framework\TestCase
{ {
private QAQuestion $question; private QAQuestion $question;
@ -37,10 +38,7 @@ final class QAQuestionTest extends \PHPUnit\Framework\TestCase
$this->question = new QAQuestion(); $this->question = new QAQuestion();
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\QAQuestion
* @group module
*/
public function testDefault() : void public function testDefault() : void
{ {
self::assertEquals(0, $this->question->id); self::assertEquals(0, $this->question->id);
@ -62,10 +60,7 @@ final class QAQuestionTest extends \PHPUnit\Framework\TestCase
self::assertEquals(0, $this->question->getAnswerCount()); self::assertEquals(0, $this->question->getAnswerCount());
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\QAQuestion
* @group module
*/
public function testAnswerInputOutput() : void public function testAnswerInputOutput() : void
{ {
$answer = new QAAnswer(); $answer = new QAAnswer();
@ -81,10 +76,7 @@ final class QAQuestionTest extends \PHPUnit\Framework\TestCase
self::assertEquals(2, $this->question->getAnswerCount()); self::assertEquals(2, $this->question->getAnswerCount());
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\QAQuestion
* @group module
*/
public function testVoteInputOutput() : void public function testVoteInputOutput() : void
{ {
$vote = new QAQuestionVote(); $vote = new QAQuestionVote();
@ -97,10 +89,7 @@ final class QAQuestionTest extends \PHPUnit\Framework\TestCase
self::assertEquals(1, $this->question->getAccountVoteScore(1)); self::assertEquals(1, $this->question->getAccountVoteScore(1));
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\QAQuestion
* @group module
*/
public function testSerialize() : void public function testSerialize() : void
{ {
$this->question->name = 'Test Title'; $this->question->name = 'Test Title';

View File

@ -21,13 +21,11 @@ use Modules\QA\Models\QAQuestionVoteMapper;
/** /**
* @internal * @internal
*/ */
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\QA\Models\QAQuestionVoteMapper::class)]
final class QAQuestionVoteMapperTest extends \PHPUnit\Framework\TestCase final class QAQuestionVoteMapperTest extends \PHPUnit\Framework\TestCase
{ {
/** #[\PHPUnit\Framework\Attributes\DependsExternal('\Modules\QA\tests\Models\QAQuestionMapperTest', 'testCRUD')]
* @depends Modules\QA\tests\Models\QAQuestionMapperTest::testCRUD #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\QAQuestionVoteMapper
* @group module
*/
public function testCRUD() : void public function testCRUD() : void
{ {
\Modules\Admin\tests\Helper::createAccounts(1); \Modules\Admin\tests\Helper::createAccounts(1);

View File

@ -19,6 +19,7 @@ use Modules\QA\Models\QAQuestionVote;
/** /**
* @internal * @internal
*/ */
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\QA\Models\QAQuestionVote::class)]
final class QAQuestionVoteTest extends \PHPUnit\Framework\TestCase final class QAQuestionVoteTest extends \PHPUnit\Framework\TestCase
{ {
private QAQuestionVote $vote; private QAQuestionVote $vote;
@ -31,10 +32,7 @@ final class QAQuestionVoteTest extends \PHPUnit\Framework\TestCase
$this->vote = new QAQuestionVote(); $this->vote = new QAQuestionVote();
} }
/** #[\PHPUnit\Framework\Attributes\Group('module')]
* @covers \Modules\QA\Models\QAQuestionVote
* @group module
*/
public function testDefault() : void public function testDefault() : void
{ {
self::assertEquals(0, $this->vote->id); self::assertEquals(0, $this->vote->id);

View File

@ -1,31 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="Bootstrap.php" colors="true" columns="120" stopOnError="true" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" beStrictAboutTestsThatDoNotTestAnything="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="Bootstrap.php" colors="true" columns="120" stopOnError="true" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" beStrictAboutTestsThatDoNotTestAnything="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd" cacheDirectory=".phpunit.cache">
<coverage includeUncoveredFiles="true" processUncoveredFiles="false"> <coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">../</directory>
</include>
<exclude>
<directory>../vendor*</directory>
<directory>../MainRepository*</directory>
<directory>../Karaka*</directory>
<directory>../Admin/Install/Application*</directory>
<directory>../phpOMS*</directory>
<directory>../tests*</directory>
<directory>../*/tests*</directory>
<directory>../**/tests*</directory>
<directory>*/tests*</directory>
<directory suffix="tpl.php">../*</directory>
<directory suffix="lang.php">../*</directory>
<directory suffix="Test.php">../*</directory>
<directory suffix="Routes.php">../*</directory>
<directory suffix="Hooks.php">../*</directory>
<directory>../**/test*</directory>
<directory>../**/Theme*</directory>
<directory>../**/Admin/Routes*</directory>
<directory>../**/Admin/Hooks*</directory>
<directory>../**/Admin/Install*</directory>
<directory>../Media/Files*</directory>
</exclude>
<report> <report>
<clover outputFile="coverage.xml"/> <clover outputFile="coverage.xml"/>
<html outputDirectory="../tests" lowUpperBound="75" highLowerBound="95"/> <html outputDirectory="../tests" lowUpperBound="75" highLowerBound="95"/>
@ -56,4 +31,31 @@
<const name="WEB_SERVER_DOCROOT" value="./Karaka"/> <const name="WEB_SERVER_DOCROOT" value="./Karaka"/>
<const name="RESET" value="1"/> <const name="RESET" value="1"/>
</php> </php>
<source>
<include>
<directory suffix=".php">../</directory>
</include>
<exclude>
<directory>../vendor*</directory>
<directory>../MainRepository*</directory>
<directory>../Karaka*</directory>
<directory>../Admin/Install/Application*</directory>
<directory>../phpOMS*</directory>
<directory>../tests*</directory>
<directory>../*/tests*</directory>
<directory>../**/tests*</directory>
<directory>*/tests*</directory>
<directory suffix="tpl.php">../*</directory>
<directory suffix="lang.php">../*</directory>
<directory suffix="Test.php">../*</directory>
<directory suffix="Routes.php">../*</directory>
<directory suffix="Hooks.php">../*</directory>
<directory>../**/test*</directory>
<directory>../**/Theme*</directory>
<directory>../**/Admin/Routes*</directory>
<directory>../**/Admin/Hooks*</directory>
<directory>../**/Admin/Install*</directory>
<directory>../Media/Files*</directory>
</exclude>
</source>
</phpunit> </phpunit>