Skip to content

Commit

Permalink
✅ fix ci for standalone run (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
julianzimmermann committed Jun 16, 2023
1 parent e573b78 commit aa4d23d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
use FondOfOryx\Client\RepresentativeCompanyUserTradeFairRestApi\RepresentativeCompanyUserTradeFairRestApiClientInterface;
use FondOfOryx\Glue\RepresentativeCompanyUserTradeFairRestApi\Processor\Builder\RestResponseBuilderInterface;
use FondOfOryx\Glue\RepresentativeCompanyUserTradeFairRestApi\Processor\Mapper\RepresentationMapperInterface;
use FondOfOryx\Shared\RepresentativeCompanyUserTradeFairRestApi\RepresentativeCompanyUserTradeFairRestApiConstants;
use Spryker\Glue\GlueApplication\Rest\JsonApi\RestResponseInterface;
use Spryker\Glue\GlueApplication\Rest\Request\Data\RestRequestInterface;
use Spryker\Zed\Api\ApiConfig;

class TradeFairRepresentationManager implements TradeFairRepresentationManagerInterface
{
Expand Down Expand Up @@ -54,7 +54,7 @@ public function add(RestRequestInterface $restRequest): RestResponseInterface

if ($representationRestResponseTransfer->getError() !== null) {
return $this->responseBuilder
->createRestErrorResponse($representationRestResponseTransfer->getError(), ApiConfig::HTTP_CODE_VALIDATION_ERRORS);
->createRestErrorResponse($representationRestResponseTransfer->getError(), RepresentativeCompanyUserTradeFairRestApiConstants::HTTP_CODE_VALIDATION_ERRORS);
}

return $this->responseBuilder
Expand All @@ -75,7 +75,7 @@ public function get(RestRequestInterface $restRequest): RestResponseInterface

if ($representationRestResponseTransfer->getError() !== null) {
return $this->responseBuilder
->createRestErrorResponse($representationRestResponseTransfer->getError(), ApiConfig::HTTP_CODE_VALIDATION_ERRORS);
->createRestErrorResponse($representationRestResponseTransfer->getError(), RepresentativeCompanyUserTradeFairRestApiConstants::HTTP_CODE_VALIDATION_ERRORS);
}

return $this->responseBuilder->buildRepresentativeCompanyUserTradeFairCollectionRestResponse($representationRestResponseTransfer->getCollection());
Expand All @@ -95,7 +95,7 @@ public function patch(RestRequestInterface $restRequest): RestResponseInterface

if ($representationRestResponseTransfer->getError() !== null) {
return $this->responseBuilder
->createRestErrorResponse($representationRestResponseTransfer->getError(), ApiConfig::HTTP_CODE_VALIDATION_ERRORS);
->createRestErrorResponse($representationRestResponseTransfer->getError(), RepresentativeCompanyUserTradeFairRestApiConstants::HTTP_CODE_VALIDATION_ERRORS);
}

return $this->responseBuilder->buildRepresentativeCompanyUserTradeFairRestResponse($representationRestResponseTransfer->getRepresentation());
Expand All @@ -115,7 +115,7 @@ public function delete(RestRequestInterface $restRequest): RestResponseInterface

if ($representationRestResponseTransfer->getError() !== null) {
return $this->responseBuilder
->createRestErrorResponse($representationRestResponseTransfer->getError(), ApiConfig::HTTP_CODE_VALIDATION_ERRORS);
->createRestErrorResponse($representationRestResponseTransfer->getError(), RepresentativeCompanyUserTradeFairRestApiConstants::HTTP_CODE_VALIDATION_ERRORS);
}

return $this->responseBuilder->buildRepresentativeCompanyUserTradeFairRestResponse($representationRestResponseTransfer->getRepresentation());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

interface RepresentativeCompanyUserTradeFairRestApiConstants
{
/**
* @var int
*/
public const HTTP_CODE_VALIDATION_ERRORS = 422;

/**
* @var string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ class RepresentativeCompanyUserTradeFairResourceControllerTest extends Unit
*/
protected RestResponseInterface|MockObject $restResponseMock;

/**
* @var \FondOfOryx\Glue\RepresentativeCompanyUserTradeFairRestApi\Controller\RepresentativeCompanyUserTradeFairResourceController|\PHPUnit\Framework\MockObject\MockObject
*/
protected RepresentativeCompanyUserTradeFairResourceController|MockObject $resourceController;

/**
* @return void
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use FondOfOryx\Client\RepresentativeCompanyUserTradeFairRestApi\RepresentativeCompanyUserTradeFairRestApiClientInterface;
use FondOfOryx\Glue\RepresentativeCompanyUserTradeFairRestApi\Processor\Builder\RestResponseBuilderInterface;
use FondOfOryx\Glue\RepresentativeCompanyUserTradeFairRestApi\Processor\Mapper\RepresentationMapperInterface;
use FondOfOryx\Shared\RepresentativeCompanyUserTradeFairRestApi\RepresentativeCompanyUserTradeFairRestApiConstants;
use Generated\Shared\Transfer\RepresentativeCompanyUserTradeFairCollectionTransfer;
use Generated\Shared\Transfer\RepresentativeCompanyUserTradeFairTransfer;
use Generated\Shared\Transfer\RestRepresentativeCompanyUserTradeFairAttributesTransfer;
Expand All @@ -14,7 +15,6 @@
use PHPUnit\Framework\MockObject\MockObject;
use Spryker\Glue\GlueApplication\Rest\JsonApi\RestResponseInterface;
use Spryker\Glue\GlueApplication\Rest\Request\Data\RestRequestInterface;
use Spryker\Zed\Api\ApiConfig;

class TradeFairRepresentationManagerTest extends Unit
{
Expand Down Expand Up @@ -211,7 +211,7 @@ public function testAddWithError(): void

$this->responseBuilderMock->expects(static::atLeastOnce())
->method('createRestErrorResponse')
->with('error', ApiConfig::HTTP_CODE_VALIDATION_ERRORS)
->with('error', RepresentativeCompanyUserTradeFairRestApiConstants::HTTP_CODE_VALIDATION_ERRORS)
->willReturn($this->restResponseMock);

$response = $this->tradeFairRepresentationManager
Expand Down Expand Up @@ -291,7 +291,7 @@ public function testGetWithError(): void

$this->responseBuilderMock->expects(static::atLeastOnce())
->method('createRestErrorResponse')
->with('error', ApiConfig::HTTP_CODE_VALIDATION_ERRORS)
->with('error', RepresentativeCompanyUserTradeFairRestApiConstants::HTTP_CODE_VALIDATION_ERRORS)
->willReturn($this->restResponseMock);

$response = $this->tradeFairRepresentationManager->get($this->restRequestMock);
Expand Down Expand Up @@ -370,7 +370,7 @@ public function testPatchWithError(): void

$this->responseBuilderMock->expects(static::atLeastOnce())
->method('createRestErrorResponse')
->with('error', ApiConfig::HTTP_CODE_VALIDATION_ERRORS)
->with('error', RepresentativeCompanyUserTradeFairRestApiConstants::HTTP_CODE_VALIDATION_ERRORS)
->willReturn($this->restResponseMock);

$response = $this->tradeFairRepresentationManager->patch($this->restRequestMock);
Expand Down Expand Up @@ -449,7 +449,7 @@ public function testDeleteWithError(): void

$this->responseBuilderMock->expects(static::atLeastOnce())
->method('createRestErrorResponse')
->with('error', ApiConfig::HTTP_CODE_VALIDATION_ERRORS)
->with('error', RepresentativeCompanyUserTradeFairRestApiConstants::HTTP_CODE_VALIDATION_ERRORS)
->willReturn($this->restResponseMock);

$response = $this->tradeFairRepresentationManager->delete($this->restRequestMock);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TradeFairRepresentationManagerTest extends Unit
/**
* @var \PHPUnit\Framework\MockObject\MockObject|\FondOfOryx\Zed\RepresentativeCompanyUserTradeFairRestApi\Business\Validator\DurationValidatorInterface
*/
protected DurationValidatorInterface $durationValidatorMock;
protected DurationValidatorInterface|MockObject $durationValidatorMock;

/**
* @var \PHPUnit\Framework\MockObject\MockObject|\FondOfOryx\Zed\RepresentativeCompanyUserTradeFairRestApi\Dependency\Facade\RepresentativeCompanyUserTradeFairRestApiToRepresentativeCompanyUserTradeFairFacadeInterface
Expand Down Expand Up @@ -70,7 +70,7 @@ class TradeFairRepresentationManagerTest extends Unit
protected $representativeCompanyUserTradeFairCollectionTransferMock;

/**
* @var \FondOfOryx\Zed\RepresentativeCompanyUserTradeFairRestApi\Business\Model\TradeFairRepresentationManagerInterface
* @var \FondOfOryx\Zed\RepresentativeCompanyUserTradeFairRestApi\Business\Model\TradeFairRepresentationManager
*/
protected TradeFairRepresentationManager $tradeFairRepresentation;

Expand Down

0 comments on commit aa4d23d

Please sign in to comment.