Replaced the mock CommentedType with ArrayType

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