diff --git a/Tests/Fixtures/Common/correct.txt b/Tests/Fixtures/Common/correct.txt new file mode 100644 index 0000000000..e8795d19b2 --- /dev/null +++ b/Tests/Fixtures/Common/correct.txt @@ -0,0 +1 @@ +Correct result diff --git a/Tests/Functional/Common/IiifUrlReaderTest.php b/Tests/Functional/Common/IiifUrlReaderTest.php new file mode 100644 index 0000000000..ccc52320a2 --- /dev/null +++ b/Tests/Functional/Common/IiifUrlReaderTest.php @@ -0,0 +1,33 @@ + + * + * 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)); + } +}