-
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
8766a28
commit 21fa633
Showing
9 changed files
with
92 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace IfCastle\Exceptions\Resource\FileSystem; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class FileCloseErrorTest extends TestCase | ||
{ | ||
public function test(): void | ||
{ | ||
$exception = new FileCloseError('file.txt'); | ||
$this->assertEquals("'FileSystem' error: operation 'close' for the resource 'file.txt' ('file') is failed. FileSystem error: operation \"close\" failed", $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,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace IfCastle\Exceptions\Resource\FileSystem; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class FileLockFailedTest extends TestCase | ||
{ | ||
public function test(): void | ||
{ | ||
$exception = new FileLockFailed('file.txt'); | ||
$this->assertEquals("'FileSystem' error: operation 'lock' for the resource 'file.txt' ('file') is failed. FileSystem error: operation \"lock\" failed", $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,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace IfCastle\Exceptions\Resource\FileSystem; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class FileNotExistsTest extends TestCase | ||
{ | ||
public function test(): void | ||
{ | ||
$exception = new FileNotExists('file.txt'); | ||
$this->assertEquals("'FileSystem' error: 'file' is not exist. Resource: 'STRING', Operation: 'is_file'", $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\Resource\FileSystem; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class FileNotReadableTest extends TestCase | ||
{ | ||
public function testNotReadable(): void | ||
{ | ||
$exception = new FileNotReadable('file.txt', 'file'); | ||
|
||
$this->assertEquals("'FileSystem' error: operation 'readable' for the resource 'file.txt' ('file') is failed. FileSystem error: operation \"readable\" failed", $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,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace IfCastle\Exceptions\Resource\FileSystem; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class FileUnLockFailedTest extends TestCase | ||
{ | ||
public function test(): void | ||
{ | ||
$exception = new FileUnLockFailed('file', 'string'); | ||
|
||
$this->assertEquals([ | ||
'resource' => 'file', | ||
'type' => 'string', | ||
'operation' => 'unlock', | ||
'system' => 'FileSystem', | ||
'message' => 'FileSystem error: operation "unlock" failed', | ||
], $exception->getExceptionData()); | ||
} | ||
} |
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