diff --git a/composer.json b/composer.json index 6e3c754e..806dd18f 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "require": { "php": ">=8.0", "cycle/orm": "^2.2.0", - "cycle/schema-builder": "^2.1.0", + "cycle/schema-builder": "^2.2", "doctrine/annotations": "^1.13", "spiral/attributes": "^2.8|^3.0", "spiral/tokenizer": "^2.8|^3.0", diff --git a/src/Annotation/Column.php b/src/Annotation/Column.php index 5344c44b..888166ee 100644 --- a/src/Annotation/Column.php +++ b/src/Annotation/Column.php @@ -37,7 +37,8 @@ final class Column * @param bool $castDefault */ public function __construct( - #[ExpectedValues(values: ['primary', 'bigPrimary', 'enum', 'boolean', 'integer', 'tinyInteger', 'bigInteger', + #[ExpectedValues(values: ['primary', 'bigPrimary', 'enum', 'boolean', + 'integer', 'tinyInteger', 'smallInteger', 'bigInteger', 'string', 'text', 'tinyText', 'longText', 'double', 'float', 'decimal', 'datetime', 'date', 'time', 'timestamp', 'binary', 'tinyBinary', 'longBinary', 'json', 'uuid', ])] diff --git a/tests/Annotated/Functional/Driver/Common/InvalidTest.php b/tests/Annotated/Functional/Driver/Common/InvalidTest.php index 5a13426c..857b48f3 100644 --- a/tests/Annotated/Functional/Driver/Common/InvalidTest.php +++ b/tests/Annotated/Functional/Driver/Common/InvalidTest.php @@ -18,6 +18,7 @@ use Cycle\Schema\Generator\SyncTables; use Cycle\Schema\Generator\ValidateEntities; use Cycle\Schema\Registry; +use Spiral\Attributes\AnnotationReader; use Spiral\Attributes\ReaderInterface; use Spiral\Tokenizer\Config\TokenizerConfig; use Spiral\Tokenizer\Tokenizer; @@ -59,10 +60,12 @@ public function testInvalidRelation(ReaderInterface $reader): void */ public function testNotDefinedColumnTypeShouldThrowAnException(ReaderInterface $reader): void { + $message = $reader instanceof AnnotationReader + ? 'Too few arguments to function Cycle\Annotated\Annotation\Column::__construct(), 0 passed' + : 'Some of required arguments [`type`] is missed on `Cycle\Annotated\Tests\Fixtures\Fixtures4\User.id.`'; + $this->expectException(AnnotationException::class); - // $this->expectErrorMessage( - // 'Some of required arguments [`type`] is missed on `Cycle\Annotated\Tests\Fixtures\Fixtures4\User.id.`' - // ); + $this->expectErrorMessage($message); $tokenizer = new Tokenizer(new TokenizerConfig([ 'directories' => [__DIR__ . '/../../../Fixtures/Fixtures4'],