Replaced the mock CommentedType with ArrayType

parent 2f548d62
...@@ -15,7 +15,6 @@ use Doctrine\DBAL\Schema\Index; ...@@ -15,7 +15,6 @@ use Doctrine\DBAL\Schema\Index;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\Tests\Types\CommentedType;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use function get_class; use function get_class;
use function implode; use function implode;
...@@ -117,12 +116,8 @@ abstract class AbstractPlatformTestCase extends TestCase ...@@ -117,12 +116,8 @@ abstract class AbstractPlatformTestCase extends TestCase
*/ */
public function testRegistersCommentedDoctrineMappingTypeImplicitly() : void public function testRegistersCommentedDoctrineMappingTypeImplicitly() : void
{ {
if (! Type::hasType('my_commented')) { $type = Type::getType('array');
Type::addType('my_commented', CommentedType::class); $this->platform->registerDoctrineTypeMapping('foo', 'array');
}
$type = Type::getType('my_commented');
$this->platform->registerDoctrineTypeMapping('foo', 'my_commented');
self::assertTrue($this->platform->isCommentedDoctrineType($type)); self::assertTrue($this->platform->isCommentedDoctrineType($type));
} }
......
<?php
namespace Doctrine\Tests\Types;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\Type;
use function strtoupper;
class CommentedType extends Type
{
/**
* {@inheritDoc}
*/
public function getName()
{
return 'my_commented';
}
/**
* {@inheritDoc}
*/
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
return strtoupper($this->getName());
}
/**
* {@inheritDoc}
*/
public function requiresSQLCommentHint(AbstractPlatform $platform)
{
return true;
}
}
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