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