Commit 6a20c28e authored by Terje Bråten's avatar Terje Bråten Committed by Steve Müller

Added a unit test for the type JsonArray, to test empty string conversion.

parent b4d9ceb2
<?php
namespace Doctrine\Tests\DBAL\Types;
use Doctrine\DBAL\Types\Type;
use Doctrine\Tests\DBAL\Mocks\MockPlatform;
require_once __DIR__ . '/../../TestInit.php';
class JsonArrayTest extends \Doctrine\Tests\DbalTestCase
{
/**
* @var \Doctrine\Tests\DBAL\Mocks\MockPlatform
*/
protected $platform;
/**
* @var \Doctrine\DBAL\Types\JsonArrayType
*/
protected $type;
/**
* {@inheritdoc}
*/
protected function setUp()
{
$this->platform = new MockPlatform();
$this->type = Type::getType('json_array');
}
public function testJsonEmptyStringConvertsToPHPValue()
{
$this->assertSame(array(), $this->type->convertToPHPValue('', $this->platform));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment