-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TEST] Test Loading Non Existing File Triggers Exception
Related To: #90
- Loading branch information
1 parent
2210f6f
commit 22ee563
Showing
1 changed file
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/* | ||
* FluentDOM | ||
* | ||
* @link https://thomas.weinert.info/FluentDOM/ | ||
* @copyright Copyright 2009-2021 FluentDOM Contributors | ||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License | ||
* | ||
*/ | ||
|
||
namespace FluentDOM { | ||
|
||
use FluentDOM\Exceptions\LoadingError\FileNotLoaded; | ||
use FluentDOM\Loader\Options as LoaderOptions; | ||
|
||
require_once __DIR__.'/../TestCase.php'; | ||
|
||
class Issue90Test extends TestCase { | ||
|
||
public function testLoadingNonExistingXMLFile(): void { | ||
$this->expectException(FileNotLoaded::class); | ||
$this->expectExceptionMessage('Could not load file: '); | ||
\FluentDOM::load( | ||
__DIR__.'/TestData/NonExisting.xml', | ||
'xml', | ||
[ LoaderOptions::ALLOW_FILE => true ] | ||
); | ||
} | ||
} | ||
|
||
} |