forked from kitodo/kitodo-presentation
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MAINTENANCE] Add test for IiifUrlReader (kitodo#909)
- Loading branch information
1 parent
2bcf180
commit 8b7880e
Showing
2 changed files
with
35 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 @@ | ||
Correct result |
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,34 @@ | ||
<?php | ||
/** | ||
* (c) Kitodo. Key to digital objects e.V. <[email protected]> | ||
* | ||
* This file is part of the Kitodo and TYPO3 projects. | ||
* | ||
* @license GNU General Public License version 3 or later. | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Kitodo\Dlf\Tests\Functional\Common; | ||
|
||
use Kitodo\Dlf\Common\IiifUrlReader; | ||
use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; | ||
|
||
class IiifUrlReaderTest extends FunctionalTestCase | ||
{ | ||
/** | ||
* @test | ||
* @group getContent | ||
*/ | ||
public function getContentCheck() | ||
{ | ||
$iiifUrlReader = new IiifUrlReader(); | ||
|
||
$correctUrl = 'http://web:8001/Tests/Fixtures/Common/correct.txt'; | ||
$expected = "Correct result\n"; | ||
$this->assertSame($expected, $iiifUrlReader->getContent($correctUrl)); | ||
|
||
$incorrectUrl = 'http://web:8001/incorrectPath'; | ||
$this->assertSame('', $iiifUrlReader->getContent($incorrectUrl)); | ||
} | ||
} |