Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Eichhorn committed Apr 26, 2024
1 parent 3c5b5bb commit 7a3bc94
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/Controller/Api/ApiControllerAttributeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

trait ApiControllerAttributeTrait
{
public int $attrType = 0;

/**
* @covers \Modules\ItemManagement\Controller\ApiController
*/
Expand All @@ -34,10 +36,11 @@ public function testApiItemAttributeTypeCreate() : void
$request->header->account = 1;
$request->setData('name', 'test_attribute');
$request->setData('title', 'EN:1');
$request->setData('repeatable', true);
$request->setData('language', ISO639x1Enum::_EN);

$this->attrModule->apiItemAttributeTypeCreate($request, $response);
self::assertGreaterThan(0, $response->getDataArray('')['response']->id);
self::assertGreaterThan(0, $this->attrType = $response->getDataArray('')['response']->id);
}

/**
Expand Down Expand Up @@ -138,6 +141,7 @@ public function testApiItemAttributeValueDatCreate() : void
/**
* @covers \Modules\ItemManagement\Controller\ApiController
*/
#[\PHPUnit\Framework\Attributes\Depends('testApiItemAttributeTypeCreate')]
#[\PHPUnit\Framework\Attributes\Group('module')]
public function testApiItemAttributeCreate() : void
{
Expand All @@ -157,7 +161,7 @@ public function testApiItemAttributeCreate() : void
$request->header->account = 1;
$request->setData('ref', '1');
$request->setData('value', '1');
$request->setData('type', '1');
$request->setData('type', $this->attrType);

$this->attrModule->apiItemAttributeCreate($request, $response);
self::assertGreaterThan(0, $response->getDataArray('')['response']->id);
Expand Down
1 change: 1 addition & 0 deletions tests/Controller/Api/ApiControllerL11nTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function testApiItemL11nTypeCreate() : void
/**
* @covers \Modules\ItemManagement\Controller\ApiController
*/
#[\PHPUnit\Framework\Attributes\Depends('testApiItemL11nTypeCreate')]
#[\PHPUnit\Framework\Attributes\Group('module')]
public function testApiItemL11nCreate() : void
{
Expand Down

0 comments on commit 7a3bc94

Please sign in to comment.