Skip to content

Commit

Permalink
Add test for IiifUrlReader
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-stoehr committed May 19, 2023
1 parent 09156ea commit f7384b5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions Tests/Fixtures/Common/correct.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Correct result
33 changes: 33 additions & 0 deletions Tests/Functional/Common/IiifUrlReaderTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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));
}
}

0 comments on commit f7384b5

Please sign in to comment.