Skip to content

Commit

Permalink
OXDEV-8216: Change constants to private; Add deactivation Exception t…
Browse files Browse the repository at this point in the history
…est;
  • Loading branch information
MarcelOxid committed Aug 12, 2024
1 parent 3004007 commit 8299ccb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Module/Exception/ModuleActivationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

final class ModuleActivationException extends NotFound
{
public const EXCEPTION_MESSAGE = "An error occurred while activating the module.";
private const EXCEPTION_MESSAGE = "An error occurred while activating the module.";

public function __construct()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Module/Exception/ModuleDeactivationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

final class ModuleDeactivationException extends NotFound
{
public const EXCEPTION_MESSAGE = "An error occurred while deactivating the module.";
private const EXCEPTION_MESSAGE = "An error occurred while deactivating the module.";

public function __construct()
{
Expand Down
11 changes: 10 additions & 1 deletion tests/Unit/Module/Exception/ModuleActivationExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,27 @@
namespace OxidEsales\GraphQL\ConfigurationAccess\Tests\Unit\Module\Exception;

use OxidEsales\GraphQL\ConfigurationAccess\Module\Exception\ModuleActivationException;
use OxidEsales\GraphQL\ConfigurationAccess\Module\Exception\ModuleDeactivationException;
use PHPUnit\Framework\TestCase;

/**
* @covers \OxidEsales\GraphQL\ConfigurationAccess\Module\Exception\ModuleActivationException
*/
final class ModuleActivationExceptionTest extends TestCase
{
public function testException(): void
public function testActivationException(): void
{
$exception = new ModuleActivationException();

$this->assertInstanceOf(ModuleActivationException::class, $exception);
$this->assertSame('An error occurred while activating the module.', $exception->getMessage());
}

public function testDeactivationException(): void
{
$exception = new ModuleDeactivationException();

$this->assertInstanceOf(ModuleDeactivationException::class, $exception);
$this->assertSame('An error occurred while deactivating the module.', $exception->getMessage());
}
}

0 comments on commit 8299ccb

Please sign in to comment.