-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7eb0afc
commit 2a7f6e5
Showing
9 changed files
with
92 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace IfCastle\Exceptions; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class InterfaceNotImplementedTest extends TestCase | ||
{ | ||
public function test(): void | ||
{ | ||
$exception = new InterfaceNotImplemented('myClassName', 'Interface'); | ||
$this->assertEquals("Class 'myClassName' does not implement interface 'Interface'", $exception->getMessage()); | ||
|
||
$exception = new InterfaceNotImplemented(new \stdClass(), 'Interface'); | ||
$this->assertEquals("Class 'stdClass' does not implement interface 'Interface'", $exception->getMessage()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace IfCastle\Exceptions; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class ObjectNotInitializedTest extends TestCase | ||
{ | ||
public function test(): void | ||
{ | ||
$exception = new ObjectNotInitialized('name', 'Additional message'); | ||
|
||
$this->assertEquals("Object 'STRING' is not initialized. Additional message", $exception->getMessage()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace IfCastle\Exceptions; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class RecursionLimitExceededTest extends TestCase | ||
{ | ||
public function test(): void | ||
{ | ||
$exception = new RecursionLimitExceeded(12); | ||
|
||
$this->assertEquals("Recursion limit exceeded: '12'", $exception->getMessage()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace IfCastle\Exceptions; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class RequiredValueEmptyTest extends TestCase | ||
{ | ||
public function test(): void | ||
{ | ||
$exception = new RequiredValueEmpty('name', 'string3'); | ||
|
||
$this->assertEquals("The Required value 'name' is empty (expected: 'string3')", $exception->getMessage()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace IfCastle\Exceptions; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class SerializeExceptionTest extends TestCase | ||
{ | ||
public function test(): void | ||
{ | ||
$exception = new SerializeException('reason', new \stdClass(), 'phpserialize', new \stdClass()); | ||
|
||
$this->assertEquals("Serialize process was failed (type:'phpserialize', object:'stdClass', src:'stdClass'). reason", $exception->getMessage()); | ||
} | ||
} |