Skip to content

Commit

Permalink
[MAINTENANCE] Add test for IiifUrlReader (kitodo#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-stoehr authored Oct 26, 2023
1 parent 2bcf180 commit 8b7880e
Show file tree
Hide file tree
Showing 2 changed files with 35 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
34 changes: 34 additions & 0 deletions Tests/Functional/Common/IiifUrlReaderTest.php
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));
}
}

0 comments on commit 8b7880e

Please sign in to comment.