Removed obsolete method in InputReader

This commit is contained in:
Marcin Kurczewski 2014-11-22 14:47:25 +01:00
parent 01a84ee4e2
commit 116522498d
2 changed files with 0 additions and 31 deletions

View file

@ -25,16 +25,6 @@ final class InputReader extends \ArrayObject
return parent::offsetGet($index);
}
public function decodeBase64($base64string)
{
if ($base64string === null)
return null;
$commaPosition = strpos($base64string, ',');
if ($commaPosition !== null)
$base64string = substr($base64string, $commaPosition + 1);
return base64_decode($base64string);
}
public function readFile($fileName)
{
if (!isset($_FILES[$fileName]))

View file

@ -1,21 +0,0 @@
<?php
namespace Szurubooru\Tests\Helpers;
use Szurubooru\Helpers\InputReader;
use Szurubooru\Tests\AbstractTestCase;
final class InputReaderTest extends AbstractTestCase
{
public function testDecodingBase64()
{
$inputReader = new InputReader();
$actual = $inputReader->decodeBase64('data:text/plain,YXdlc29tZSBkb2c=');
$expected = 'awesome dog';
$this->assertEquals($expected, $actual);
}
public function testDecodingEmptyBase64()
{
$inputReader = new InputReader();
$this->assertNull($inputReader->decodeBase64($inputReader->iDontEvenExist));
}
}