Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:acelaya/doctrine-enum-type
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya committed Dec 6, 2017
2 parents 0a437f8 + 1130efe commit f4cd29c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Type/PhpEnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,13 @@ public static function registerEnumTypes(array $types)
static::registerEnumType($typeName, $enumClass);
}
}

/**
* @param AbstractPlatform $platform
* @return boolean
*/
public function requiresSQLCommentHint(AbstractPlatform $platform)
{
return true;
}
}
11 changes: 11 additions & 0 deletions tests/Type/PhpEnumTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,15 @@ public function usingChildCustomEnumTypeRegisteredValueIsCorrect()
$type->getSQLDeclaration([], $this->platform->reveal())
);
}

/**
* @test
*/
public function SQLCommentHintIsAlwaysRequired()
{
PhpEnumType::registerEnumType(Gender::class);
$type = Type::getType(Gender::class);

$this->assertTrue($type->requiresSQLCommentHint($this->platform->reveal()));
}
}

0 comments on commit f4cd29c

Please sign in to comment.