Skip to content

Commit

Permalink
[TEST] Test Loading Non Existing File Triggers Exception
Browse files Browse the repository at this point in the history
Related To: #90
  • Loading branch information
ThomasWeinert committed Apr 18, 2021
1 parent 2210f6f commit 22ee563
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/FluentDOM/Issues/Issue90Test.php
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 ]
);
}
}

}

0 comments on commit 22ee563

Please sign in to comment.