2014-09-15 11:38:24 +02:00
|
|
|
<?php
|
|
|
|
namespace Szurubooru\Tests\Helpers;
|
2014-10-08 14:47:47 +02:00
|
|
|
use Szurubooru\Helpers\InputReader;
|
|
|
|
use Szurubooru\Tests\AbstractTestCase;
|
2014-09-15 11:38:24 +02:00
|
|
|
|
2014-10-08 14:47:47 +02:00
|
|
|
final class InputReaderTest extends AbstractTestCase
|
2014-09-15 11:38:24 +02:00
|
|
|
{
|
|
|
|
public function testDecodingBase64()
|
|
|
|
{
|
2014-10-08 14:47:47 +02:00
|
|
|
$inputReader = new InputReader();
|
2014-09-15 11:38:24 +02:00
|
|
|
$actual = $inputReader->decodeBase64('data:text/plain,YXdlc29tZSBkb2c=');
|
|
|
|
$expected = 'awesome dog';
|
|
|
|
$this->assertEquals($expected, $actual);
|
|
|
|
}
|
2014-09-20 12:45:56 +02:00
|
|
|
|
|
|
|
public function testDecodingEmptyBase64()
|
|
|
|
{
|
2014-10-08 14:47:47 +02:00
|
|
|
$inputReader = new InputReader();
|
2014-09-20 12:45:56 +02:00
|
|
|
$this->assertNull($inputReader->decodeBase64($inputReader->iDontEvenExist));
|
|
|
|
}
|
2014-09-15 11:38:24 +02:00
|
|
|
}
|