mirror of
https://github.com/Karaka-Management/oms-ProjectManagement.git
synced 2026-01-29 07:48:39 +00:00
upgrade phpunit
This commit is contained in:
parent
4d1e8d202d
commit
acc6e7254a
|
|
@ -19,31 +19,23 @@ use Modules\ProjectManagement\Models\NullProjectAttribute;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\ProjectManagement\Models\NullProjectAttribute::class)]
|
||||
final class NullProjectAttributeTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\NullProjectAttribute
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testNull() : void
|
||||
{
|
||||
self::assertInstanceOf('\Modules\ProjectManagement\Models\ProjectAttribute', new NullProjectAttribute());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\NullProjectAttribute
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testId() : void
|
||||
{
|
||||
$null = new NullProjectAttribute(2);
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\NullProjectAttribute
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testJsonSerialize() : void
|
||||
{
|
||||
$null = new NullProjectAttribute(2);
|
||||
|
|
|
|||
|
|
@ -19,31 +19,23 @@ use Modules\ProjectManagement\Models\NullProjectAttributeType;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\ProjectManagement\Models\NullProjectAttributeType::class)]
|
||||
final class NullProjectAttributeTypeTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\NullProjectAttributeType
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testNull() : void
|
||||
{
|
||||
self::assertInstanceOf('\Modules\ProjectManagement\Models\ProjectAttributeType', new NullProjectAttributeType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\NullProjectAttributeType
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testId() : void
|
||||
{
|
||||
$null = new NullProjectAttributeType(2);
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\NullProjectAttributeType
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testJsonSerialize() : void
|
||||
{
|
||||
$null = new NullProjectAttributeType(2);
|
||||
|
|
|
|||
|
|
@ -19,31 +19,23 @@ use Modules\ProjectManagement\Models\NullProjectAttributeValue;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\ProjectManagement\Models\NullProjectAttributeValue::class)]
|
||||
final class NullProjectAttributeValueTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\NullProjectAttributeValue
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testNull() : void
|
||||
{
|
||||
self::assertInstanceOf('\Modules\ProjectManagement\Models\ProjectAttributeValue', new NullProjectAttributeValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\NullProjectAttributeValue
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testId() : void
|
||||
{
|
||||
$null = new NullProjectAttributeValue(2);
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\NullProjectAttributeValue
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testJsonSerialize() : void
|
||||
{
|
||||
$null = new NullProjectAttributeValue(2);
|
||||
|
|
|
|||
|
|
@ -19,31 +19,23 @@ use Modules\ProjectManagement\Models\NullProject;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\ProjectManagement\Models\NullProject::class)]
|
||||
final class NullProjectTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\NullProject
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testNull() : void
|
||||
{
|
||||
self::assertInstanceOf('\Modules\ProjectManagement\Models\Project', new NullProject());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\NullProject
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testId() : void
|
||||
{
|
||||
$null = new NullProject(2);
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\NullProject
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testJsonSerialize() : void
|
||||
{
|
||||
$null = new NullProject(2);
|
||||
|
|
|
|||
|
|
@ -26,12 +26,10 @@ use phpOMS\Stdlib\Base\FloatInt;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\ProjectManagement\Models\ProjectMapper::class)]
|
||||
final class ProjectMapperTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\ProjectMapper
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testCRUD() : void
|
||||
{
|
||||
$project = new Project();
|
||||
|
|
@ -97,10 +95,7 @@ final class ProjectMapperTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals(\end($expected)->name, \end($actual)->name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\ProjectMapper
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testNewest() : void
|
||||
{
|
||||
$newest = ProjectMapper::getAll()->sort('id', OrderType::DESC)->limit(1)->execute();
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ use phpOMS\Stdlib\Base\FloatInt;
|
|||
/**
|
||||
* @internal
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\ProjectManagement\Models\Project::class)]
|
||||
final class ProjectTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
private Project $project;
|
||||
|
|
@ -34,10 +35,7 @@ final class ProjectTest extends \PHPUnit\Framework\TestCase
|
|||
$this->project = new Project();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\Project
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertEquals(0, $this->project->id);
|
||||
|
|
@ -58,60 +56,42 @@ final class ProjectTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEmpty($this->project->tasks);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\Project
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testCreatedByInputOutput() : void
|
||||
{
|
||||
$this->project->createdBy = new NullAccount(1);
|
||||
self::assertEquals(1, $this->project->createdBy->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\Project
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testNameInputOutput() : void
|
||||
{
|
||||
$this->project->setName('Name');
|
||||
self::assertEquals('Name', $this->project->getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\Project
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testDescriptionInputOutput() : void
|
||||
{
|
||||
$this->project->description = 'Description';
|
||||
self::assertEquals('Description', $this->project->description);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\Project
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testProgressInputOutput() : void
|
||||
{
|
||||
$this->project->progress = 10;
|
||||
self::assertEquals(10, $this->project->progress);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\Project
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testProgressTypeInputOutput() : void
|
||||
{
|
||||
$this->project->setProgressType(ProgressType::TASKS);
|
||||
self::assertEquals(ProgressType::TASKS, $this->project->getProgressType());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Modules\ProjectManagement\Models\Project
|
||||
* @group module
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\Group('module')]
|
||||
public function testSerialize() : void
|
||||
{
|
||||
$this->project->setName('Name');
|
||||
|
|
|
|||
|
|
@ -1,31 +1,6 @@
|
|||
<?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">
|
||||
<coverage includeUncoveredFiles="true" processUncoveredFiles="false">
|
||||
<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>
|
||||
<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">
|
||||
<report>
|
||||
<clover outputFile="coverage.xml"/>
|
||||
<html outputDirectory="../tests" lowUpperBound="75" highLowerBound="95"/>
|
||||
|
|
@ -56,4 +31,31 @@
|
|||
<const name="WEB_SERVER_DOCROOT" value="./Karaka"/>
|
||||
<const name="RESET" value="1"/>
|
||||
</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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user