-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
090b249
commit e19eb0f
Showing
4 changed files
with
93 additions
and
2 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
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,49 @@ | ||
FROM php:7.4-alpine | ||
MAINTAINER Christian Kuhn <[email protected]> | ||
|
||
# We use convenient install-php-extensions script to manage additional php extensions | ||
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ | ||
|
||
RUN apk add --no-cache \ | ||
bash \ | ||
file \ | ||
git \ | ||
graphicsmagick \ | ||
grep \ | ||
patch \ | ||
&& chmod +x /usr/local/bin/install-php-extensions \ | ||
&& sync \ | ||
&& install-php-extensions \ | ||
apcu \ | ||
bcmath \ | ||
bz2 \ | ||
@composer-2 \ | ||
gd \ | ||
gettext \ | ||
gmp \ | ||
intl \ | ||
memcached \ | ||
mysqli \ | ||
opcache \ | ||
pdo_mysql \ | ||
pdo_pgsql \ | ||
pdo_sqlsrv \ | ||
pgsql \ | ||
pspell \ | ||
redis \ | ||
soap \ | ||
sockets \ | ||
sqlsrv \ | ||
sysvsem \ | ||
# we need to pin xdebug to a specific version now, as 3.2+ is not compatible with image php version | ||
xdebug-3.1.5 \ | ||
zip \ | ||
&& mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \ | ||
&& sed -i s/';phar.readonly = On'/'phar.readonly = Off'/ $PHP_INI_DIR/php.ini \ | ||
&& sed -i s/'memory_limit = 128M'/'memory_limit = 2G'/ $PHP_INI_DIR/php.ini \ | ||
&& sed -i s/'max_execution_time = 30'/'max_execution_time = 240'/ $PHP_INI_DIR/php.ini \ | ||
&& sed -i s/';max_input_vars = 1000'/'max_input_vars = 1500'/ $PHP_INI_DIR/php.ini \ | ||
&& echo "xdebug.max_nesting_level = 400" >> $PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini \ | ||
&& echo "apc.enable_cli=1" >> $PHP_INI_DIR/conf.d/docker-php-ext-apcu.ini \ | ||
&& echo "apc.slam_defense=0" >> $PHP_INI_DIR/conf.d/docker-php-ext-apcu.ini \ | ||
&& rm -rf /var/cache/apk/* |
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,40 @@ | ||
<?php | ||
|
||
namespace Kitodo\Dlf\Tests\Unit\Common; | ||
|
||
use Kitodo\Dlf\Common\IiifUrlReader; | ||
use TYPO3\TestingFramework\Core\Unit\UnitTestCase; | ||
use donatj\MockWebServer\MockWebServer; | ||
use donatj\MockWebServer\Response; | ||
|
||
class IiifUrlReaderTest extends UnitTestCase | ||
{ | ||
|
||
/** @var MockWebServer */ | ||
protected static $mockServer; | ||
|
||
public static function setUpBeforeClass() : void { | ||
self::$mockServer = new MockWebServer; | ||
self::$mockServer->start(); | ||
} | ||
|
||
public static function tearDownAfterClass() : void { | ||
// stopping the web server during tear down allows us to reuse the port for later tests | ||
self::$mockServer->stop(); | ||
} | ||
|
||
/** | ||
* @test | ||
* @group getContent | ||
*/ | ||
public function getContentCheck() { | ||
$iiifUrlReader = new IiifUrlReader(); | ||
|
||
$correctUrl = self::$mockServer->setResponseOfPath('/correctPath', new Response('Correct result')); | ||
$this->assertSame('Correct result', $iiifUrlReader->getContent($correctUrl)); | ||
|
||
$incorrectUrl = self::$mockServer->setResponseOfPath('/incorrectPath', | ||
new Response('', [], 500)); | ||
$this->assertSame('', $iiifUrlReader->getContent($incorrectUrl)); | ||
} | ||
} |
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