Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINTENANCE] Add test for IiifUrlReader #909

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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));
}
}