From 2041114cdd7dc529b536caed40a65c47b4bf08e5 Mon Sep 17 00:00:00 2001 From: Simon Mundy Date: Tue, 4 Aug 2026 13:54:32 +1000 Subject: [PATCH 1/2] Reformatting for linting, format and analysis with Mago --- .../Object/AbstractTableObjectTest.php | 64 ++- .../unit/Metadata/Object/ColumnObjectTest.php | 188 ++++---- .../Object/ConstraintKeyObjectTest.php | 120 ++--- .../Metadata/Object/ConstraintObjectTest.php | 246 +++++----- test/unit/Metadata/Object/TableObjectTest.php | 53 ++- .../Metadata/Object/TriggerObjectTest.php | 181 +++---- test/unit/Metadata/Object/ViewObjectTest.php | 120 +++-- .../Metadata/Source/AbstractSourceTest.php | 448 ++++++++++-------- 8 files changed, 805 insertions(+), 615 deletions(-) diff --git a/test/unit/Metadata/Object/AbstractTableObjectTest.php b/test/unit/Metadata/Object/AbstractTableObjectTest.php index eafeca84..6a9ee383 100644 --- a/test/unit/Metadata/Object/AbstractTableObjectTest.php +++ b/test/unit/Metadata/Object/AbstractTableObjectTest.php @@ -8,11 +8,13 @@ use PhpDb\Metadata\Object\ColumnObject; use PhpDb\Metadata\Object\ConstraintObject; use PhpDbTest\Metadata\Object\TestAsset\ConcreteTableObject; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; final class AbstractTableObjectTest extends TestCase { - public function testCompleteTableObjectWithAllProperties(): void + #[Test] + public function completeTableObjectWithAllProperties(): void { $table = $this->createConcreteTableObject('users'); @@ -31,54 +33,60 @@ public function testCompleteTableObjectWithAllProperties(): void $table->setConstraints($constraints); // Verify all properties are set correctly - self::assertSame('users', $table->getName()); - self::assertSame($columns, $table->getColumns()); - self::assertCount(3, $table->getColumns()); - self::assertSame($constraints, $table->getConstraints()); - self::assertCount(2, $table->getConstraints()); + static::assertSame('users', $table->getName()); + static::assertSame($columns, $table->getColumns()); + static::assertCount(3, $table->getColumns()); + static::assertSame($constraints, $table->getConstraints()); + static::assertCount(2, $table->getConstraints()); } - public function testConstructorWithEmptyString(): void + #[Test] + public function constructorWithEmptyString(): void { $table = $this->createConcreteTableObject(''); // Verify empty string is converted to null - self::assertNull($table->getName()); + static::assertNull($table->getName()); } - public function testConstructorWithName(): void + #[Test] + public function constructorWithName(): void { $table = $this->createConcreteTableObject('table_name'); // Verify name is set correctly - self::assertSame('table_name', $table->getName()); + static::assertSame('table_name', $table->getName()); } - public function testConstructorWithNullName(): void + #[Test] + public function constructorWithNullName(): void { $table = $this->createConcreteTableObject(null); // Verify null name is preserved - self::assertNull($table->getName()); + static::assertNull($table->getName()); } - public function testGetColumnsReturnsNullWhenNotSet(): void + #[Test] + public function getColumnsReturnsNullWhenNotSet(): void { $table = $this->createConcreteTableObject('table'); // Verify columns return null when not set - self::assertNull($table->getColumns()); + static::assertNull($table->getColumns()); } - public function testGetConstraintsReturnsNullWhenNotSet(): void + #[Test] + public function getConstraintsReturnsNullWhenNotSet(): void { $table = $this->createConcreteTableObject('table'); // Verify constraints return null when not set - self::assertNull($table->getConstraints()); + static::assertNull($table->getConstraints()); } - public function testSetColumnsAndGetColumns(): void + #[Test] + public function setColumnsAndGetColumns(): void { $table = $this->createConcreteTableObject('table'); $columns = [ @@ -88,19 +96,21 @@ public function testSetColumnsAndGetColumns(): void // Set columns and verify retrieval $table->setColumns($columns); - self::assertSame($columns, $table->getColumns()); + static::assertSame($columns, $table->getColumns()); } - public function testSetColumnsWithEmptyArray(): void + #[Test] + public function setColumnsWithEmptyArray(): void { $table = $this->createConcreteTableObject('table'); // Set empty columns array and verify $table->setColumns([]); - self::assertSame([], $table->getColumns()); + static::assertSame([], $table->getColumns()); } - public function testSetConstraintsAndGetConstraints(): void + #[Test] + public function setConstraintsAndGetConstraints(): void { $table = $this->createConcreteTableObject('table'); $constraints = [ @@ -110,25 +120,27 @@ public function testSetConstraintsAndGetConstraints(): void // Set constraints and verify retrieval $table->setConstraints($constraints); - self::assertSame($constraints, $table->getConstraints()); + static::assertSame($constraints, $table->getConstraints()); } - public function testSetConstraintsWithEmptyArray(): void + #[Test] + public function setConstraintsWithEmptyArray(): void { $table = $this->createConcreteTableObject('table'); // Set empty constraints array and verify $table->setConstraints([]); - self::assertSame([], $table->getConstraints()); + static::assertSame([], $table->getConstraints()); } - public function testSetNameAndGetName(): void + #[Test] + public function setNameAndGetName(): void { $table = $this->createConcreteTableObject('initial_name'); // Update name and verify change $table->setName('new_name'); - self::assertSame('new_name', $table->getName()); + static::assertSame('new_name', $table->getName()); } private function createConcreteTableObject(?string $name): AbstractTableObject diff --git a/test/unit/Metadata/Object/ColumnObjectTest.php b/test/unit/Metadata/Object/ColumnObjectTest.php index bad62869..adb2fbf2 100644 --- a/test/unit/Metadata/Object/ColumnObjectTest.php +++ b/test/unit/Metadata/Object/ColumnObjectTest.php @@ -5,11 +5,13 @@ namespace PhpDbTest\Metadata\Object; use PhpDb\Metadata\Object\ColumnObject; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; final class ColumnObjectTest extends TestCase { - public function testCompleteColumnObjectWithAllProperties(): void + #[Test] + public function completeColumnObjectWithAllProperties(): void { $column = new ColumnObject('id', 'users', 'public'); @@ -25,158 +27,173 @@ public function testCompleteColumnObjectWithAllProperties(): void ->setErratas(['auto_increment' => true, 'comment' => 'Primary key']); // Verify all properties are set correctly - self::assertSame('id', $column->getName()); - self::assertSame('users', $column->getTableName()); - self::assertSame('public', $column->getSchemaName()); - self::assertSame(1, $column->getOrdinalPosition()); - self::assertSame('0', $column->getColumnDefault()); - self::assertFalse($column->getIsNullable()); - self::assertSame('INT', $column->getDataType()); - self::assertNull($column->getCharacterMaximumLength()); - self::assertNull($column->getCharacterOctetLength()); - self::assertSame(10, $column->getNumericPrecision()); - self::assertSame(0, $column->getNumericScale()); - self::assertTrue($column->isNumericUnsigned()); - self::assertTrue($column->getErrata('auto_increment')); - self::assertSame('Primary key', $column->getErrata('comment')); + static::assertSame('id', $column->getName()); + static::assertSame('users', $column->getTableName()); + static::assertSame('public', $column->getSchemaName()); + static::assertSame(1, $column->getOrdinalPosition()); + static::assertSame('0', $column->getColumnDefault()); + static::assertFalse($column->getIsNullable()); + static::assertSame('INT', $column->getDataType()); + static::assertNull($column->getCharacterMaximumLength()); + static::assertNull($column->getCharacterOctetLength()); + static::assertSame(10, $column->getNumericPrecision()); + static::assertSame(0, $column->getNumericScale()); + static::assertTrue($column->isNumericUnsigned()); + static::assertTrue($column->getErrata('auto_increment')); + static::assertSame('Primary key', $column->getErrata('comment')); } - public function testConstructorWithAllParameters(): void + #[Test] + public function constructorWithAllParameters(): void { $column = new ColumnObject('column_name', 'table_name', 'schema_name'); // Verify all constructor parameters are set - self::assertSame('column_name', $column->getName()); - self::assertSame('table_name', $column->getTableName()); - self::assertSame('schema_name', $column->getSchemaName()); + static::assertSame('column_name', $column->getName()); + static::assertSame('table_name', $column->getTableName()); + static::assertSame('schema_name', $column->getSchemaName()); } - public function testConstructorWithNullSchema(): void + #[Test] + public function constructorWithNullSchema(): void { $column = new ColumnObject('column_name', 'table_name'); // Verify schema defaults to null - self::assertSame('column_name', $column->getName()); - self::assertSame('table_name', $column->getTableName()); - self::assertNull($column->getSchemaName()); + static::assertSame('column_name', $column->getName()); + static::assertSame('table_name', $column->getTableName()); + static::assertNull($column->getSchemaName()); } - public function testGetErrataNonExistentKeyReturnsNull(): void + #[Test] + public function getErrataNonExistentKeyReturnsNull(): void { $column = new ColumnObject('column', 'table', 'schema'); // Verify non-existent key returns null - self::assertNull($column->getErrata('non_existent')); + static::assertNull($column->getErrata('non_existent')); } - public function testGetErratasReturnsEmptyArrayInitially(): void + #[Test] + public function getErratasReturnsEmptyArrayInitially(): void { $column = new ColumnObject('column', 'table', 'schema'); // Verify erratas default to empty array - self::assertSame([], $column->getErratas()); + static::assertSame([], $column->getErratas()); } - public function testIsNullableAlias(): void + #[Test] + public function isNullableAlias(): void { $column = new ColumnObject('column', 'table', 'schema'); // Verify alias method returns same value $column->setIsNullable(false); - self::assertFalse($column->getIsNullable()); + static::assertFalse($column->getIsNullable()); } - public function testIsNumericUnsignedAlias(): void + #[Test] + public function isNumericUnsignedAlias(): void { $column = new ColumnObject('column', 'table', 'schema'); // Verify alias method returns same value $column->setNumericUnsigned(false); - self::assertFalse($column->isNumericUnsigned()); - self::assertSame($column->getNumericUnsigned(), $column->isNumericUnsigned()); + static::assertFalse($column->isNumericUnsigned()); + static::assertSame($column->getNumericUnsigned(), $column->isNumericUnsigned()); } - public function testSetCharacterMaximumLengthAndGetCharacterMaximumLengthWithFluentInterface(): void + #[Test] + public function setCharacterMaximumLengthAndGetCharacterMaximumLengthWithFluentInterface(): void { $column = new ColumnObject('column', 'table', 'schema'); // Verify fluent interface and value update $result = $column->setCharacterMaximumLength(255); - self::assertSame($column, $result); - self::assertSame(255, $column->getCharacterMaximumLength()); + static::assertSame($column, $result); + static::assertSame(255, $column->getCharacterMaximumLength()); } - public function testSetCharacterMaximumLengthWithNull(): void + #[Test] + public function setCharacterMaximumLengthWithNull(): void { $column = new ColumnObject('column', 'table', 'schema'); $column->setCharacterMaximumLength(255); // Set length to null and verify $column->setCharacterMaximumLength(null); - self::assertNull($column->getCharacterMaximumLength()); + static::assertNull($column->getCharacterMaximumLength()); } - public function testSetCharacterOctetLengthAndGetCharacterOctetLengthWithFluentInterface(): void + #[Test] + public function setCharacterOctetLengthAndGetCharacterOctetLengthWithFluentInterface(): void { $column = new ColumnObject('column', 'table', 'schema'); // Verify fluent interface and value update $result = $column->setCharacterOctetLength(1024); - self::assertSame($column, $result); - self::assertSame(1024, $column->getCharacterOctetLength()); + static::assertSame($column, $result); + static::assertSame(1024, $column->getCharacterOctetLength()); } - public function testSetCharacterOctetLengthWithNull(): void + #[Test] + public function setCharacterOctetLengthWithNull(): void { $column = new ColumnObject('column', 'table', 'schema'); $column->setCharacterOctetLength(1024); // Set octet length to null and verify $column->setCharacterOctetLength(null); - self::assertNull($column->getCharacterOctetLength()); + static::assertNull($column->getCharacterOctetLength()); } - public function testSetColumnDefaultAndGetColumnDefaultWithFluentInterface(): void + #[Test] + public function setColumnDefaultAndGetColumnDefaultWithFluentInterface(): void { $column = new ColumnObject('column', 'table', 'schema'); // Verify fluent interface and value update $result = $column->setColumnDefault('DEFAULT_VALUE'); - self::assertSame($column, $result); - self::assertSame('DEFAULT_VALUE', $column->getColumnDefault()); + static::assertSame($column, $result); + static::assertSame('DEFAULT_VALUE', $column->getColumnDefault()); } - public function testSetColumnDefaultWithNull(): void + #[Test] + public function setColumnDefaultWithNull(): void { $column = new ColumnObject('column', 'table', 'schema'); $column->setColumnDefault('initial'); // Set default to null and verify $column->setColumnDefault(null); - self::assertNull($column->getColumnDefault()); + static::assertNull($column->getColumnDefault()); } - public function testSetDataTypeAndGetDataTypeWithFluentInterface(): void + #[Test] + public function setDataTypeAndGetDataTypeWithFluentInterface(): void { $column = new ColumnObject('column', 'table', 'schema'); // Verify fluent interface and value update $result = $column->setDataType('VARCHAR'); - self::assertSame($column, $result); - self::assertSame('VARCHAR', $column->getDataType()); + static::assertSame($column, $result); + static::assertSame('VARCHAR', $column->getDataType()); } - public function testSetErrataAndGetErrata(): void + #[Test] + public function setErrataAndGetErrata(): void { $column = new ColumnObject('column', 'table', 'schema'); // Set single errata and verify fluent interface $result = $column->setErrata('key1', 'value1'); - self::assertSame($column, $result); - self::assertSame('value1', $column->getErrata('key1')); + static::assertSame($column, $result); + static::assertSame('value1', $column->getErrata('key1')); } - public function testSetErratasIteratesCorrectly(): void + #[Test] + public function setErratasIteratesCorrectly(): void { $column = new ColumnObject('column', 'table', 'schema'); $erratas = [ @@ -186,11 +203,12 @@ public function testSetErratasIteratesCorrectly(): void // Verify each errata is accessible individually $column->setErratas($erratas); - self::assertSame('value1', $column->getErrata('key1')); - self::assertSame('value2', $column->getErrata('key2')); + static::assertSame('value1', $column->getErrata('key1')); + static::assertSame('value2', $column->getErrata('key2')); } - public function testSetErratasWithArrayAndGetErratas(): void + #[Test] + public function setErratasWithArrayAndGetErratas(): void { $column = new ColumnObject('column', 'table', 'schema'); $erratas = [ @@ -201,85 +219,93 @@ public function testSetErratasWithArrayAndGetErratas(): void // Set multiple erratas and verify fluent interface $result = $column->setErratas($erratas); - self::assertSame($column, $result); - self::assertSame($erratas, $column->getErratas()); + static::assertSame($column, $result); + static::assertSame($erratas, $column->getErratas()); } - public function testSetIsNullableAndGetIsNullableWithFluentInterface(): void + #[Test] + public function setIsNullableAndGetIsNullableWithFluentInterface(): void { $column = new ColumnObject('column', 'table', 'schema'); // Verify fluent interface and value update $result = $column->setIsNullable(true); - self::assertSame($column, $result); - self::assertTrue($column->getIsNullable()); + static::assertSame($column, $result); + static::assertTrue($column->getIsNullable()); } - public function testSetNameAndGetName(): void + #[Test] + public function setNameAndGetName(): void { $column = new ColumnObject('initial', 'table', 'schema'); // Update name and verify change $column->setName('new_name'); - self::assertSame('new_name', $column->getName()); + static::assertSame('new_name', $column->getName()); } - public function testSetNumericPrecisionAndGetNumericPrecisionWithFluentInterface(): void + #[Test] + public function setNumericPrecisionAndGetNumericPrecisionWithFluentInterface(): void { $column = new ColumnObject('column', 'table', 'schema'); // Verify fluent interface and value update $result = $column->setNumericPrecision(10); - self::assertSame($column, $result); - self::assertSame(10, $column->getNumericPrecision()); + static::assertSame($column, $result); + static::assertSame(10, $column->getNumericPrecision()); } - public function testSetNumericScaleAndGetNumericScaleWithFluentInterface(): void + #[Test] + public function setNumericScaleAndGetNumericScaleWithFluentInterface(): void { $column = new ColumnObject('column', 'table', 'schema'); // Verify fluent interface and value update $result = $column->setNumericScale(2); - self::assertSame($column, $result); - self::assertSame(2, $column->getNumericScale()); + static::assertSame($column, $result); + static::assertSame(2, $column->getNumericScale()); } - public function testSetNumericUnsignedAndGetNumericUnsignedWithFluentInterface(): void + #[Test] + public function setNumericUnsignedAndGetNumericUnsignedWithFluentInterface(): void { $column = new ColumnObject('column', 'table', 'schema'); // Verify fluent interface and value update $result = $column->setNumericUnsigned(true); - self::assertSame($column, $result); - self::assertTrue($column->getNumericUnsigned()); + static::assertSame($column, $result); + static::assertTrue($column->getNumericUnsigned()); } - public function testSetOrdinalPositionAndGetOrdinalPositionWithFluentInterface(): void + #[Test] + public function setOrdinalPositionAndGetOrdinalPositionWithFluentInterface(): void { $column = new ColumnObject('column', 'table', 'schema'); // Verify fluent interface and value update $result = $column->setOrdinalPosition(5); - self::assertSame($column, $result); - self::assertSame(5, $column->getOrdinalPosition()); + static::assertSame($column, $result); + static::assertSame(5, $column->getOrdinalPosition()); } - public function testSetSchemaNameAndGetSchemaName(): void + #[Test] + public function setSchemaNameAndGetSchemaName(): void { $column = new ColumnObject('column', 'table', 'initial_schema'); // Update schema and verify change $column->setSchemaName('new_schema'); - self::assertSame('new_schema', $column->getSchemaName()); + static::assertSame('new_schema', $column->getSchemaName()); } - public function testSetTableNameAndGetTableNameWithFluentInterface(): void + #[Test] + public function setTableNameAndGetTableNameWithFluentInterface(): void { $column = new ColumnObject('column', 'initial_table', 'schema'); // Verify fluent interface and value update $result = $column->setTableName('new_table'); - self::assertSame($column, $result); - self::assertSame('new_table', $column->getTableName()); + static::assertSame($column, $result); + static::assertSame('new_table', $column->getTableName()); } } diff --git a/test/unit/Metadata/Object/ConstraintKeyObjectTest.php b/test/unit/Metadata/Object/ConstraintKeyObjectTest.php index 77e6074c..7eb77141 100644 --- a/test/unit/Metadata/Object/ConstraintKeyObjectTest.php +++ b/test/unit/Metadata/Object/ConstraintKeyObjectTest.php @@ -5,11 +5,13 @@ namespace PhpDbTest\Metadata\Object; use PhpDb\Metadata\Object\ConstraintKeyObject; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; final class ConstraintKeyObjectTest extends TestCase { - public function testCompleteConstraintKeyObject(): void + #[Test] + public function completeConstraintKeyObject(): void { $constraintKey = new ConstraintKeyObject('user_id'); @@ -22,167 +24,179 @@ public function testCompleteConstraintKeyObject(): void $constraintKey->setForeignKeyDeleteRule(ConstraintKeyObject::FK_RESTRICT); // Verify all properties are set correctly - self::assertSame('user_id', $constraintKey->getColumnName()); - self::assertSame(1, $constraintKey->getOrdinalPosition()); - self::assertFalse($constraintKey->getPositionInUniqueConstraint()); - self::assertSame('public', $constraintKey->getReferencedTableSchema()); - self::assertSame('users', $constraintKey->getReferencedTableName()); - self::assertSame('id', $constraintKey->getReferencedColumnName()); - self::assertSame('CASCADE', $constraintKey->getForeignKeyUpdateRule()); - self::assertSame('RESTRICT', $constraintKey->getForeignKeyDeleteRule()); + static::assertSame('user_id', $constraintKey->getColumnName()); + static::assertSame(1, $constraintKey->getOrdinalPosition()); + static::assertFalse($constraintKey->getPositionInUniqueConstraint()); + static::assertSame('public', $constraintKey->getReferencedTableSchema()); + static::assertSame('users', $constraintKey->getReferencedTableName()); + static::assertSame('id', $constraintKey->getReferencedColumnName()); + static::assertSame('CASCADE', $constraintKey->getForeignKeyUpdateRule()); + static::assertSame('RESTRICT', $constraintKey->getForeignKeyDeleteRule()); } - public function testConstructorSetsColumnName(): void + #[Test] + public function constructorSetsColumnName(): void { $constraintKey = new ConstraintKeyObject('column_name'); // Verify column name is set by constructor - self::assertSame('column_name', $constraintKey->getColumnName()); + static::assertSame('column_name', $constraintKey->getColumnName()); } - public function testForeignKeyConstants(): void + #[Test] + public function foreignKeyConstants(): void { // Verify all foreign key constants are defined correctly - self::assertSame('CASCADE', ConstraintKeyObject::FK_CASCADE); - self::assertSame('SET NULL', ConstraintKeyObject::FK_SET_NULL); - self::assertSame('NO ACTION', ConstraintKeyObject::FK_NO_ACTION); - self::assertSame('RESTRICT', ConstraintKeyObject::FK_RESTRICT); - self::assertSame('SET DEFAULT', ConstraintKeyObject::FK_SET_DEFAULT); + static::assertSame('CASCADE', ConstraintKeyObject::FK_CASCADE); + static::assertSame('SET NULL', ConstraintKeyObject::FK_SET_NULL); + static::assertSame('NO ACTION', ConstraintKeyObject::FK_NO_ACTION); + static::assertSame('RESTRICT', ConstraintKeyObject::FK_RESTRICT); + static::assertSame('SET DEFAULT', ConstraintKeyObject::FK_SET_DEFAULT); } - public function testSetColumnNameAndGetColumnNameWithFluentInterface(): void + #[Test] + public function setColumnNameAndGetColumnNameWithFluentInterface(): void { $constraintKey = new ConstraintKeyObject('initial'); // Verify fluent interface and value update $result = $constraintKey->setColumnName('new_column'); - self::assertSame($constraintKey, $result); - self::assertSame('new_column', $constraintKey->getColumnName()); + static::assertSame($constraintKey, $result); + static::assertSame('new_column', $constraintKey->getColumnName()); } - public function testSetForeignKeyDeleteRuleAndGetForeignKeyDeleteRule(): void + #[Test] + public function setForeignKeyDeleteRuleAndGetForeignKeyDeleteRule(): void { $constraintKey = new ConstraintKeyObject('column'); // Set delete rule and verify retrieval $constraintKey->setForeignKeyDeleteRule(ConstraintKeyObject::FK_RESTRICT); - self::assertSame('RESTRICT', $constraintKey->getForeignKeyDeleteRule()); + static::assertSame('RESTRICT', $constraintKey->getForeignKeyDeleteRule()); // Verify mutation by changing to different value $constraintKey->setForeignKeyDeleteRule(ConstraintKeyObject::FK_CASCADE); - self::assertSame('CASCADE', $constraintKey->getForeignKeyDeleteRule()); + static::assertSame('CASCADE', $constraintKey->getForeignKeyDeleteRule()); } - public function testSetForeignKeyDeleteRuleWithAllConstants(): void + #[Test] + public function setForeignKeyDeleteRuleWithAllConstants(): void { $constraintKey = new ConstraintKeyObject('column'); // Verify CASCADE constant $constraintKey->setForeignKeyDeleteRule(ConstraintKeyObject::FK_CASCADE); - self::assertSame('CASCADE', $constraintKey->getForeignKeyDeleteRule()); + static::assertSame('CASCADE', $constraintKey->getForeignKeyDeleteRule()); // Verify SET NULL constant $constraintKey->setForeignKeyDeleteRule(ConstraintKeyObject::FK_SET_NULL); - self::assertSame('SET NULL', $constraintKey->getForeignKeyDeleteRule()); + static::assertSame('SET NULL', $constraintKey->getForeignKeyDeleteRule()); // Verify NO ACTION constant $constraintKey->setForeignKeyDeleteRule(ConstraintKeyObject::FK_NO_ACTION); - self::assertSame('NO ACTION', $constraintKey->getForeignKeyDeleteRule()); + static::assertSame('NO ACTION', $constraintKey->getForeignKeyDeleteRule()); // Verify RESTRICT constant $constraintKey->setForeignKeyDeleteRule(ConstraintKeyObject::FK_RESTRICT); - self::assertSame('RESTRICT', $constraintKey->getForeignKeyDeleteRule()); + static::assertSame('RESTRICT', $constraintKey->getForeignKeyDeleteRule()); // Verify SET DEFAULT constant $constraintKey->setForeignKeyDeleteRule(ConstraintKeyObject::FK_SET_DEFAULT); - self::assertSame('SET DEFAULT', $constraintKey->getForeignKeyDeleteRule()); + static::assertSame('SET DEFAULT', $constraintKey->getForeignKeyDeleteRule()); } - public function testSetForeignKeyUpdateRuleAndGetForeignKeyUpdateRule(): void + #[Test] + public function setForeignKeyUpdateRuleAndGetForeignKeyUpdateRule(): void { $constraintKey = new ConstraintKeyObject('column'); // Set update rule and verify retrieval $constraintKey->setForeignKeyUpdateRule(ConstraintKeyObject::FK_CASCADE); - self::assertSame('CASCADE', $constraintKey->getForeignKeyUpdateRule()); + static::assertSame('CASCADE', $constraintKey->getForeignKeyUpdateRule()); // Verify mutation by changing to different value $constraintKey->setForeignKeyUpdateRule(ConstraintKeyObject::FK_RESTRICT); - self::assertSame('RESTRICT', $constraintKey->getForeignKeyUpdateRule()); + static::assertSame('RESTRICT', $constraintKey->getForeignKeyUpdateRule()); } - public function testSetForeignKeyUpdateRuleWithAllConstants(): void + #[Test] + public function setForeignKeyUpdateRuleWithAllConstants(): void { $constraintKey = new ConstraintKeyObject('column'); // Verify CASCADE constant $constraintKey->setForeignKeyUpdateRule(ConstraintKeyObject::FK_CASCADE); - self::assertSame('CASCADE', $constraintKey->getForeignKeyUpdateRule()); + static::assertSame('CASCADE', $constraintKey->getForeignKeyUpdateRule()); // Verify SET NULL constant $constraintKey->setForeignKeyUpdateRule(ConstraintKeyObject::FK_SET_NULL); - self::assertSame('SET NULL', $constraintKey->getForeignKeyUpdateRule()); + static::assertSame('SET NULL', $constraintKey->getForeignKeyUpdateRule()); // Verify NO ACTION constant $constraintKey->setForeignKeyUpdateRule(ConstraintKeyObject::FK_NO_ACTION); - self::assertSame('NO ACTION', $constraintKey->getForeignKeyUpdateRule()); + static::assertSame('NO ACTION', $constraintKey->getForeignKeyUpdateRule()); // Verify RESTRICT constant $constraintKey->setForeignKeyUpdateRule(ConstraintKeyObject::FK_RESTRICT); - self::assertSame('RESTRICT', $constraintKey->getForeignKeyUpdateRule()); + static::assertSame('RESTRICT', $constraintKey->getForeignKeyUpdateRule()); // Verify SET DEFAULT constant $constraintKey->setForeignKeyUpdateRule(ConstraintKeyObject::FK_SET_DEFAULT); - self::assertSame('SET DEFAULT', $constraintKey->getForeignKeyUpdateRule()); + static::assertSame('SET DEFAULT', $constraintKey->getForeignKeyUpdateRule()); } - public function testSetOrdinalPositionAndGetOrdinalPositionWithFluentInterface(): void + #[Test] + public function setOrdinalPositionAndGetOrdinalPositionWithFluentInterface(): void { $constraintKey = new ConstraintKeyObject('column'); // Verify fluent interface and value update $result = $constraintKey->setOrdinalPosition(3); - self::assertSame($constraintKey, $result); - self::assertSame(3, $constraintKey->getOrdinalPosition()); + static::assertSame($constraintKey, $result); + static::assertSame(3, $constraintKey->getOrdinalPosition()); } - public function testSetPositionInUniqueConstraintAndGetPositionInUniqueConstraintWithFluentInterface(): void + #[Test] + public function setPositionInUniqueConstraintAndGetPositionInUniqueConstraintWithFluentInterface(): void { $constraintKey = new ConstraintKeyObject('column'); // Verify fluent interface and value update $result = $constraintKey->setPositionInUniqueConstraint(true); - self::assertSame($constraintKey, $result); - self::assertTrue($constraintKey->getPositionInUniqueConstraint()); + static::assertSame($constraintKey, $result); + static::assertTrue($constraintKey->getPositionInUniqueConstraint()); } - public function testSetReferencedColumnNameAndGetReferencedColumnNameWithFluentInterface(): void + #[Test] + public function setReferencedColumnNameAndGetReferencedColumnNameWithFluentInterface(): void { $constraintKey = new ConstraintKeyObject('column'); // Verify fluent interface and value update $result = $constraintKey->setReferencedColumnName('ref_column'); - self::assertSame($constraintKey, $result); - self::assertSame('ref_column', $constraintKey->getReferencedColumnName()); + static::assertSame($constraintKey, $result); + static::assertSame('ref_column', $constraintKey->getReferencedColumnName()); } - public function testSetReferencedTableNameAndGetReferencedTableNameWithFluentInterface(): void + #[Test] + public function setReferencedTableNameAndGetReferencedTableNameWithFluentInterface(): void { $constraintKey = new ConstraintKeyObject('column'); // Verify fluent interface and value update $result = $constraintKey->setReferencedTableName('ref_table'); - self::assertSame($constraintKey, $result); - self::assertSame('ref_table', $constraintKey->getReferencedTableName()); + static::assertSame($constraintKey, $result); + static::assertSame('ref_table', $constraintKey->getReferencedTableName()); } - public function testSetReferencedTableSchemaAndGetReferencedTableSchemaWithFluentInterface(): void + #[Test] + public function setReferencedTableSchemaAndGetReferencedTableSchemaWithFluentInterface(): void { $constraintKey = new ConstraintKeyObject('column'); // Verify fluent interface and value update $result = $constraintKey->setReferencedTableSchema('ref_schema'); - self::assertSame($constraintKey, $result); - self::assertSame('ref_schema', $constraintKey->getReferencedTableSchema()); + static::assertSame($constraintKey, $result); + static::assertSame('ref_schema', $constraintKey->getReferencedTableSchema()); } } diff --git a/test/unit/Metadata/Object/ConstraintObjectTest.php b/test/unit/Metadata/Object/ConstraintObjectTest.php index 8fe4d22a..9ad538e1 100644 --- a/test/unit/Metadata/Object/ConstraintObjectTest.php +++ b/test/unit/Metadata/Object/ConstraintObjectTest.php @@ -5,25 +5,28 @@ namespace PhpDbTest\Metadata\Object; use PhpDb\Metadata\Object\ConstraintObject; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; final class ConstraintObjectTest extends TestCase { - public function testCompleteCheckConstraint(): void + #[Test] + public function completeCheckConstraint(): void { $constraint = new ConstraintObject('chk_users_age', 'users', 'public'); $constraint->setType('CHECK'); $constraint->setCheckClause('age >= 18 AND age <= 120'); // Verify check constraint is configured correctly - self::assertTrue($constraint->isCheck()); - self::assertFalse($constraint->isPrimaryKey()); - self::assertFalse($constraint->isUnique()); - self::assertFalse($constraint->isForeignKey()); - self::assertSame('age >= 18 AND age <= 120', $constraint->getCheckClause()); + static::assertTrue($constraint->isCheck()); + static::assertFalse($constraint->isPrimaryKey()); + static::assertFalse($constraint->isUnique()); + static::assertFalse($constraint->isForeignKey()); + static::assertSame('age >= 18 AND age <= 120', $constraint->getCheckClause()); } - public function testCompleteForeignKeyConstraint(): void + #[Test] + public function completeForeignKeyConstraint(): void { $constraint = new ConstraintObject('fk_orders_user', 'orders', 'public'); $constraint->setType('FOREIGN KEY'); @@ -36,324 +39,351 @@ public function testCompleteForeignKeyConstraint(): void ->setDeleteRule('RESTRICT'); // Verify foreign key constraint is configured correctly - self::assertSame('fk_orders_user', $constraint->getName()); - self::assertTrue($constraint->isForeignKey()); - self::assertFalse($constraint->isPrimaryKey()); - self::assertFalse($constraint->isUnique()); - self::assertFalse($constraint->isCheck()); - self::assertSame(['user_id'], $constraint->getColumns()); - self::assertSame('public', $constraint->getReferencedTableSchema()); - self::assertSame('users', $constraint->getReferencedTableName()); - self::assertSame(['id'], $constraint->getReferencedColumns()); - self::assertSame('SIMPLE', $constraint->getMatchOption()); - self::assertSame('CASCADE', $constraint->getUpdateRule()); - self::assertSame('RESTRICT', $constraint->getDeleteRule()); + static::assertSame('fk_orders_user', $constraint->getName()); + static::assertTrue($constraint->isForeignKey()); + static::assertFalse($constraint->isPrimaryKey()); + static::assertFalse($constraint->isUnique()); + static::assertFalse($constraint->isCheck()); + static::assertSame(['user_id'], $constraint->getColumns()); + static::assertSame('public', $constraint->getReferencedTableSchema()); + static::assertSame('users', $constraint->getReferencedTableName()); + static::assertSame(['id'], $constraint->getReferencedColumns()); + static::assertSame('SIMPLE', $constraint->getMatchOption()); + static::assertSame('CASCADE', $constraint->getUpdateRule()); + static::assertSame('RESTRICT', $constraint->getDeleteRule()); } - public function testCompletePrimaryKeyConstraint(): void + #[Test] + public function completePrimaryKeyConstraint(): void { $constraint = new ConstraintObject('pk_users', 'users', 'public'); $constraint->setType('PRIMARY KEY'); $constraint->setColumns(['id']); // Verify primary key constraint is configured correctly - self::assertSame('pk_users', $constraint->getName()); - self::assertSame('users', $constraint->getTableName()); - self::assertSame('public', $constraint->getSchemaName()); - self::assertTrue($constraint->isPrimaryKey()); - self::assertFalse($constraint->isUnique()); - self::assertFalse($constraint->isForeignKey()); - self::assertFalse($constraint->isCheck()); - self::assertSame(['id'], $constraint->getColumns()); - self::assertTrue($constraint->hasColumns()); + static::assertSame('pk_users', $constraint->getName()); + static::assertSame('users', $constraint->getTableName()); + static::assertSame('public', $constraint->getSchemaName()); + static::assertTrue($constraint->isPrimaryKey()); + static::assertFalse($constraint->isUnique()); + static::assertFalse($constraint->isForeignKey()); + static::assertFalse($constraint->isCheck()); + static::assertSame(['id'], $constraint->getColumns()); + static::assertTrue($constraint->hasColumns()); } - public function testCompleteUniqueConstraint(): void + #[Test] + public function completeUniqueConstraint(): void { $constraint = new ConstraintObject('uq_users_email', 'users', 'public'); $constraint->setType('UNIQUE'); $constraint->setColumns(['email']); // Verify unique constraint is configured correctly - self::assertTrue($constraint->isUnique()); - self::assertFalse($constraint->isPrimaryKey()); - self::assertFalse($constraint->isForeignKey()); - self::assertFalse($constraint->isCheck()); - self::assertSame(['email'], $constraint->getColumns()); + static::assertTrue($constraint->isUnique()); + static::assertFalse($constraint->isPrimaryKey()); + static::assertFalse($constraint->isForeignKey()); + static::assertFalse($constraint->isCheck()); + static::assertSame(['email'], $constraint->getColumns()); } - public function testConstructorWithAllParameters(): void + #[Test] + public function constructorWithAllParameters(): void { $constraint = new ConstraintObject('constraint_name', 'table_name', 'schema_name'); // Verify all constructor parameters are set - self::assertSame('constraint_name', $constraint->getName()); - self::assertSame('table_name', $constraint->getTableName()); - self::assertSame('schema_name', $constraint->getSchemaName()); + static::assertSame('constraint_name', $constraint->getName()); + static::assertSame('table_name', $constraint->getTableName()); + static::assertSame('schema_name', $constraint->getSchemaName()); } - public function testConstructorWithNullSchema(): void + #[Test] + public function constructorWithNullSchema(): void { $constraint = new ConstraintObject('constraint_name', 'table_name'); // Verify schema defaults to null - self::assertSame('constraint_name', $constraint->getName()); - self::assertSame('table_name', $constraint->getTableName()); - self::assertNull($constraint->getSchemaName()); + static::assertSame('constraint_name', $constraint->getName()); + static::assertSame('table_name', $constraint->getTableName()); + static::assertNull($constraint->getSchemaName()); } - public function testHasColumnsReturnsFalseWhenEmpty(): void + #[Test] + public function hasColumnsReturnsFalseWhenEmpty(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Verify hasColumns returns false when not set - self::assertFalse($constraint->hasColumns()); + static::assertFalse($constraint->hasColumns()); } - public function testHasColumnsReturnsTrueWhenPopulated(): void + #[Test] + public function hasColumnsReturnsTrueWhenPopulated(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Verify hasColumns returns true after setting columns $constraint->setColumns(['col1', 'col2']); - self::assertTrue($constraint->hasColumns()); + static::assertTrue($constraint->hasColumns()); } - public function testIsCheckReturnsFalseForOtherTypes(): void + #[Test] + public function isCheckReturnsFalseForOtherTypes(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Verify isCheck returns false for PRIMARY KEY $constraint->setType('PRIMARY KEY'); - self::assertFalse($constraint->isCheck()); + static::assertFalse($constraint->isCheck()); // Verify isCheck returns false for UNIQUE $constraint->setType('UNIQUE'); - self::assertFalse($constraint->isCheck()); + static::assertFalse($constraint->isCheck()); // Verify isCheck returns false for FOREIGN KEY $constraint->setType('FOREIGN KEY'); - self::assertFalse($constraint->isCheck()); + static::assertFalse($constraint->isCheck()); } - public function testIsCheckReturnsTrueForCheck(): void + #[Test] + public function isCheckReturnsTrueForCheck(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Verify isCheck returns true for CHECK type $constraint->setType('CHECK'); - self::assertTrue($constraint->isCheck()); + static::assertTrue($constraint->isCheck()); } - public function testIsForeignKeyReturnsFalseForOtherTypes(): void + #[Test] + public function isForeignKeyReturnsFalseForOtherTypes(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Verify isForeignKey returns false for PRIMARY KEY $constraint->setType('PRIMARY KEY'); - self::assertFalse($constraint->isForeignKey()); + static::assertFalse($constraint->isForeignKey()); // Verify isForeignKey returns false for UNIQUE $constraint->setType('UNIQUE'); - self::assertFalse($constraint->isForeignKey()); + static::assertFalse($constraint->isForeignKey()); // Verify isForeignKey returns false for CHECK $constraint->setType('CHECK'); - self::assertFalse($constraint->isForeignKey()); + static::assertFalse($constraint->isForeignKey()); } - public function testIsForeignKeyReturnsTrueForForeignKey(): void + #[Test] + public function isForeignKeyReturnsTrueForForeignKey(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Verify isForeignKey returns true for FOREIGN KEY type $constraint->setType('FOREIGN KEY'); - self::assertTrue($constraint->isForeignKey()); + static::assertTrue($constraint->isForeignKey()); } - public function testIsPrimaryKeyReturnsFalseForOtherTypes(): void + #[Test] + public function isPrimaryKeyReturnsFalseForOtherTypes(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Verify isPrimaryKey returns false for UNIQUE $constraint->setType('UNIQUE'); - self::assertFalse($constraint->isPrimaryKey()); + static::assertFalse($constraint->isPrimaryKey()); // Verify isPrimaryKey returns false for FOREIGN KEY $constraint->setType('FOREIGN KEY'); - self::assertFalse($constraint->isPrimaryKey()); + static::assertFalse($constraint->isPrimaryKey()); // Verify isPrimaryKey returns false for CHECK $constraint->setType('CHECK'); - self::assertFalse($constraint->isPrimaryKey()); + static::assertFalse($constraint->isPrimaryKey()); } - public function testIsPrimaryKeyReturnsTrueForPrimaryKey(): void + #[Test] + public function isPrimaryKeyReturnsTrueForPrimaryKey(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Verify isPrimaryKey returns true for PRIMARY KEY type $constraint->setType('PRIMARY KEY'); - self::assertTrue($constraint->isPrimaryKey()); + static::assertTrue($constraint->isPrimaryKey()); } - public function testIsUniqueReturnsFalseForOtherTypes(): void + #[Test] + public function isUniqueReturnsFalseForOtherTypes(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Verify isUnique returns false for PRIMARY KEY $constraint->setType('PRIMARY KEY'); - self::assertFalse($constraint->isUnique()); + static::assertFalse($constraint->isUnique()); // Verify isUnique returns false for FOREIGN KEY $constraint->setType('FOREIGN KEY'); - self::assertFalse($constraint->isUnique()); + static::assertFalse($constraint->isUnique()); // Verify isUnique returns false for CHECK $constraint->setType('CHECK'); - self::assertFalse($constraint->isUnique()); + static::assertFalse($constraint->isUnique()); } - public function testIsUniqueReturnsTrueForUnique(): void + #[Test] + public function isUniqueReturnsTrueForUnique(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Verify isUnique returns true for UNIQUE type $constraint->setType('UNIQUE'); - self::assertTrue($constraint->isUnique()); + static::assertTrue($constraint->isUnique()); } - public function testSetCheckClauseAndGetCheckClauseWithFluentInterface(): void + #[Test] + public function setCheckClauseAndGetCheckClauseWithFluentInterface(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Verify fluent interface and value update $result = $constraint->setCheckClause('age >= 18'); - self::assertSame($constraint, $result); - self::assertSame('age >= 18', $constraint->getCheckClause()); + static::assertSame($constraint, $result); + static::assertSame('age >= 18', $constraint->getCheckClause()); } - public function testSetColumnsAndGetColumnsWithFluentInterface(): void + #[Test] + public function setColumnsAndGetColumnsWithFluentInterface(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); $columns = ['column1', 'column2', 'column3']; // Verify fluent interface and value update $result = $constraint->setColumns($columns); - self::assertSame($constraint, $result); - self::assertSame($columns, $constraint->getColumns()); + static::assertSame($constraint, $result); + static::assertSame($columns, $constraint->getColumns()); } - public function testSetColumnsWithEmptyArray(): void + #[Test] + public function setColumnsWithEmptyArray(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); $constraint->setColumns(['col1']); // Set empty array and verify hasColumns reflects change $constraint->setColumns([]); - self::assertSame([], $constraint->getColumns()); - self::assertFalse($constraint->hasColumns()); + static::assertSame([], $constraint->getColumns()); + static::assertFalse($constraint->hasColumns()); } - public function testSetDeleteRuleAndGetDeleteRuleWithFluentInterface(): void + #[Test] + public function setDeleteRuleAndGetDeleteRuleWithFluentInterface(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Verify fluent interface and value update $result = $constraint->setDeleteRule('RESTRICT'); - self::assertSame($constraint, $result); - self::assertSame('RESTRICT', $constraint->getDeleteRule()); + static::assertSame($constraint, $result); + static::assertSame('RESTRICT', $constraint->getDeleteRule()); } - public function testSetMatchOptionAndGetMatchOptionWithFluentInterface(): void + #[Test] + public function setMatchOptionAndGetMatchOptionWithFluentInterface(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Verify fluent interface and value update $result = $constraint->setMatchOption('FULL'); - self::assertSame($constraint, $result); - self::assertSame('FULL', $constraint->getMatchOption()); + static::assertSame($constraint, $result); + static::assertSame('FULL', $constraint->getMatchOption()); } - public function testSetNameAndGetName(): void + #[Test] + public function setNameAndGetName(): void { $constraint = new ConstraintObject('initial', 'table', 'schema'); // Update name and verify change $constraint->setName('new_name'); - self::assertSame('new_name', $constraint->getName()); + static::assertSame('new_name', $constraint->getName()); } - public function testSetReferencedColumnsAndGetReferencedColumnsWithFluentInterface(): void + #[Test] + public function setReferencedColumnsAndGetReferencedColumnsWithFluentInterface(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); $columns = ['ref_col1', 'ref_col2']; // Verify fluent interface and value update $result = $constraint->setReferencedColumns($columns); - self::assertSame($constraint, $result); - self::assertSame($columns, $constraint->getReferencedColumns()); + static::assertSame($constraint, $result); + static::assertSame($columns, $constraint->getReferencedColumns()); } - public function testSetReferencedTableNameAndGetReferencedTableNameWithFluentInterface(): void + #[Test] + public function setReferencedTableNameAndGetReferencedTableNameWithFluentInterface(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Verify fluent interface and value update $result = $constraint->setReferencedTableName('ref_table'); - self::assertSame($constraint, $result); - self::assertSame('ref_table', $constraint->getReferencedTableName()); + static::assertSame($constraint, $result); + static::assertSame('ref_table', $constraint->getReferencedTableName()); } - public function testSetReferencedTableSchemaAndGetReferencedTableSchemaWithFluentInterface(): void + #[Test] + public function setReferencedTableSchemaAndGetReferencedTableSchemaWithFluentInterface(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Verify fluent interface and value update $result = $constraint->setReferencedTableSchema('ref_schema'); - self::assertSame($constraint, $result); - self::assertSame('ref_schema', $constraint->getReferencedTableSchema()); + static::assertSame($constraint, $result); + static::assertSame('ref_schema', $constraint->getReferencedTableSchema()); } - public function testSetSchemaNameAndGetSchemaName(): void + #[Test] + public function setSchemaNameAndGetSchemaName(): void { $constraint = new ConstraintObject('name', 'table', 'initial_schema'); // Update schema and verify change $constraint->setSchemaName('new_schema'); - self::assertSame('new_schema', $constraint->getSchemaName()); + static::assertSame('new_schema', $constraint->getSchemaName()); } - public function testSetTableNameAndGetTableNameWithFluentInterface(): void + #[Test] + public function setTableNameAndGetTableNameWithFluentInterface(): void { $constraint = new ConstraintObject('name', 'initial_table', 'schema'); // Verify fluent interface and value update $result = $constraint->setTableName('new_table'); - self::assertSame($constraint, $result); - self::assertSame('new_table', $constraint->getTableName()); + static::assertSame($constraint, $result); + static::assertSame('new_table', $constraint->getTableName()); } - public function testSetTypeAndGetType(): void + #[Test] + public function setTypeAndGetType(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Set type and verify retrieval $constraint->setType('PRIMARY KEY'); - self::assertSame('PRIMARY KEY', $constraint->getType()); + static::assertSame('PRIMARY KEY', $constraint->getType()); // Verify mutation to different type $constraint->setType('UNIQUE'); - self::assertSame('UNIQUE', $constraint->getType()); + static::assertSame('UNIQUE', $constraint->getType()); } - public function testSetUpdateRuleAndGetUpdateRuleWithFluentInterface(): void + #[Test] + public function setUpdateRuleAndGetUpdateRuleWithFluentInterface(): void { $constraint = new ConstraintObject('name', 'table', 'schema'); // Verify fluent interface and value update $result = $constraint->setUpdateRule('CASCADE'); - self::assertSame($constraint, $result); - self::assertSame('CASCADE', $constraint->getUpdateRule()); + static::assertSame($constraint, $result); + static::assertSame('CASCADE', $constraint->getUpdateRule()); } } diff --git a/test/unit/Metadata/Object/TableObjectTest.php b/test/unit/Metadata/Object/TableObjectTest.php index 76ec3a6d..d6479368 100644 --- a/test/unit/Metadata/Object/TableObjectTest.php +++ b/test/unit/Metadata/Object/TableObjectTest.php @@ -8,20 +8,23 @@ use PhpDb\Metadata\Object\ColumnObject; use PhpDb\Metadata\Object\ConstraintObject; use PhpDb\Metadata\Object\TableObject; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; final class TableObjectTest extends TestCase { - public function testCanBeInstantiated(): void + #[Test] + public function canBeInstantiated(): void { $table = new TableObject('test_table'); // Verify object can be instantiated directly - self::assertInstanceOf(TableObject::class, $table); - self::assertSame('test_table', $table->getName()); + static::assertInstanceOf(TableObject::class, $table); + static::assertSame('test_table', $table->getName()); } - public function testCompleteTableObjectWithAllInheritedFunctionality(): void + #[Test] + public function completeTableObjectWithAllInheritedFunctionality(): void { $table = new TableObject('orders'); @@ -41,37 +44,41 @@ public function testCompleteTableObjectWithAllInheritedFunctionality(): void $table->setConstraints($constraints); // Verify all inherited functionality works correctly - self::assertSame('orders', $table->getName()); - self::assertCount(4, $table->getColumns()); - self::assertCount(2, $table->getConstraints()); - self::assertInstanceOf(AbstractTableObject::class, $table); + static::assertSame('orders', $table->getName()); + static::assertCount(4, $table->getColumns()); + static::assertCount(2, $table->getConstraints()); + static::assertInstanceOf(AbstractTableObject::class, $table); } - public function testConstructorWithName(): void + #[Test] + public function constructorWithName(): void { $table = new TableObject('users'); // Verify name is set by constructor - self::assertSame('users', $table->getName()); + static::assertSame('users', $table->getName()); } - public function testConstructorWithNullName(): void + #[Test] + public function constructorWithNullName(): void { $table = new TableObject(); // Verify name defaults to null when not provided - self::assertNull($table->getName()); + static::assertNull($table->getName()); } - public function testExtendsAbstractTableObject(): void + #[Test] + public function extendsAbstractTableObject(): void { $table = new TableObject('table_name'); // Verify table extends AbstractTableObject - self::assertInstanceOf(AbstractTableObject::class, $table); + static::assertInstanceOf(AbstractTableObject::class, $table); } - public function testInheritedSetColumnsWorks(): void + #[Test] + public function inheritedSetColumnsWorks(): void { $table = new TableObject('users'); $columns = [ @@ -81,11 +88,12 @@ public function testInheritedSetColumnsWorks(): void // Verify inherited setColumns method stores columns $table->setColumns($columns); - self::assertSame($columns, $table->getColumns()); - self::assertCount(2, $table->getColumns()); + static::assertSame($columns, $table->getColumns()); + static::assertCount(2, $table->getColumns()); } - public function testInheritedSetConstraintsWorks(): void + #[Test] + public function inheritedSetConstraintsWorks(): void { $table = new TableObject('users'); $constraints = [ @@ -94,16 +102,17 @@ public function testInheritedSetConstraintsWorks(): void // Verify inherited setConstraints method stores constraints $table->setConstraints($constraints); - self::assertSame($constraints, $table->getConstraints()); - self::assertCount(1, $table->getConstraints()); + static::assertSame($constraints, $table->getConstraints()); + static::assertCount(1, $table->getConstraints()); } - public function testInheritedSetNameWorks(): void + #[Test] + public function inheritedSetNameWorks(): void { $table = new TableObject('initial'); // Verify inherited setName method updates the name $table->setName('updated'); - self::assertSame('updated', $table->getName()); + static::assertSame('updated', $table->getName()); } } diff --git a/test/unit/Metadata/Object/TriggerObjectTest.php b/test/unit/Metadata/Object/TriggerObjectTest.php index 888110ed..ec41a342 100644 --- a/test/unit/Metadata/Object/TriggerObjectTest.php +++ b/test/unit/Metadata/Object/TriggerObjectTest.php @@ -6,11 +6,13 @@ use DateTime; use PhpDb\Metadata\Object\TriggerObject; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; final class TriggerObjectTest extends TestCase { - public function testCompleteTriggerObject(): void + #[Test] + public function completeTriggerObject(): void { $trigger = new TriggerObject(); $created = new DateTime('2025-11-13 10:30:00'); @@ -32,147 +34,159 @@ public function testCompleteTriggerObject(): void ->setCreated($created); // Verify all properties are set correctly - self::assertSame('audit_trigger', $trigger->getName()); - self::assertSame('UPDATE', $trigger->getEventManipulation()); - self::assertSame('main_catalog', $trigger->getEventObjectCatalog()); - self::assertSame('public', $trigger->getEventObjectSchema()); - self::assertSame('orders', $trigger->getEventObjectTable()); - self::assertSame('1', $trigger->getActionOrder()); - self::assertSame('WHEN (OLD.status != NEW.status)', $trigger->getActionCondition()); - self::assertSame('BEGIN INSERT INTO audit_log VALUES (OLD.id, NOW()); END', $trigger->getActionStatement()); - self::assertSame('ROW', $trigger->getActionOrientation()); - self::assertSame('AFTER', $trigger->getActionTiming()); - self::assertSame('old_orders', $trigger->getActionReferenceOldTable()); - self::assertSame('new_orders', $trigger->getActionReferenceNewTable()); - self::assertSame('OLD', $trigger->getActionReferenceOldRow()); - self::assertSame('NEW', $trigger->getActionReferenceNewRow()); - self::assertSame($created, $trigger->getCreated()); + static::assertSame('audit_trigger', $trigger->getName()); + static::assertSame('UPDATE', $trigger->getEventManipulation()); + static::assertSame('main_catalog', $trigger->getEventObjectCatalog()); + static::assertSame('public', $trigger->getEventObjectSchema()); + static::assertSame('orders', $trigger->getEventObjectTable()); + static::assertSame('1', $trigger->getActionOrder()); + static::assertSame('WHEN (OLD.status != NEW.status)', $trigger->getActionCondition()); + static::assertSame('BEGIN INSERT INTO audit_log VALUES (OLD.id, NOW()); END', $trigger->getActionStatement()); + static::assertSame('ROW', $trigger->getActionOrientation()); + static::assertSame('AFTER', $trigger->getActionTiming()); + static::assertSame('old_orders', $trigger->getActionReferenceOldTable()); + static::assertSame('new_orders', $trigger->getActionReferenceNewTable()); + static::assertSame('OLD', $trigger->getActionReferenceOldRow()); + static::assertSame('NEW', $trigger->getActionReferenceNewRow()); + static::assertSame($created, $trigger->getCreated()); } - public function testNullValuesForAllProperties(): void + #[Test] + public function nullValuesForAllProperties(): void { $trigger = new TriggerObject(); // Verify all properties default to null - self::assertNull($trigger->getName()); - self::assertNull($trigger->getEventManipulation()); - self::assertNull($trigger->getEventObjectCatalog()); - self::assertNull($trigger->getEventObjectSchema()); - self::assertNull($trigger->getEventObjectTable()); - self::assertNull($trigger->getActionOrder()); - self::assertNull($trigger->getActionCondition()); - self::assertNull($trigger->getActionStatement()); - self::assertNull($trigger->getActionOrientation()); - self::assertNull($trigger->getActionTiming()); - self::assertNull($trigger->getActionReferenceOldTable()); - self::assertNull($trigger->getActionReferenceNewTable()); - self::assertNull($trigger->getActionReferenceOldRow()); - self::assertNull($trigger->getActionReferenceNewRow()); - self::assertNull($trigger->getCreated()); + static::assertNull($trigger->getName()); + static::assertNull($trigger->getEventManipulation()); + static::assertNull($trigger->getEventObjectCatalog()); + static::assertNull($trigger->getEventObjectSchema()); + static::assertNull($trigger->getEventObjectTable()); + static::assertNull($trigger->getActionOrder()); + static::assertNull($trigger->getActionCondition()); + static::assertNull($trigger->getActionStatement()); + static::assertNull($trigger->getActionOrientation()); + static::assertNull($trigger->getActionTiming()); + static::assertNull($trigger->getActionReferenceOldTable()); + static::assertNull($trigger->getActionReferenceNewTable()); + static::assertNull($trigger->getActionReferenceOldRow()); + static::assertNull($trigger->getActionReferenceNewRow()); + static::assertNull($trigger->getCreated()); } - public function testSetActionConditionAndGetActionConditionWithFluentInterface(): void + #[Test] + public function setActionConditionAndGetActionConditionWithFluentInterface(): void { $trigger = new TriggerObject(); // Verify fluent interface and value update $result = $trigger->setActionCondition('WHEN (NEW.amount > 100)'); - self::assertSame($trigger, $result); - self::assertSame('WHEN (NEW.amount > 100)', $trigger->getActionCondition()); + static::assertSame($trigger, $result); + static::assertSame('WHEN (NEW.amount > 100)', $trigger->getActionCondition()); } - public function testSetActionOrderAndGetActionOrderWithFluentInterface(): void + #[Test] + public function setActionOrderAndGetActionOrderWithFluentInterface(): void { $trigger = new TriggerObject(); // Verify fluent interface and value update $result = $trigger->setActionOrder('1'); - self::assertSame($trigger, $result); - self::assertSame('1', $trigger->getActionOrder()); + static::assertSame($trigger, $result); + static::assertSame('1', $trigger->getActionOrder()); } - public function testSetActionOrientationAndGetActionOrientationWithFluentInterface(): void + #[Test] + public function setActionOrientationAndGetActionOrientationWithFluentInterface(): void { $trigger = new TriggerObject(); // Verify fluent interface and value update $result = $trigger->setActionOrientation('ROW'); - self::assertSame($trigger, $result); - self::assertSame('ROW', $trigger->getActionOrientation()); + static::assertSame($trigger, $result); + static::assertSame('ROW', $trigger->getActionOrientation()); } - public function testSetActionReferenceNewRowAndGetActionReferenceNewRowWithFluentInterface(): void + #[Test] + public function setActionReferenceNewRowAndGetActionReferenceNewRowWithFluentInterface(): void { $trigger = new TriggerObject(); // Verify fluent interface and value update $result = $trigger->setActionReferenceNewRow('NEW'); - self::assertSame($trigger, $result); - self::assertSame('NEW', $trigger->getActionReferenceNewRow()); + static::assertSame($trigger, $result); + static::assertSame('NEW', $trigger->getActionReferenceNewRow()); } - public function testSetActionReferenceNewTableAndGetActionReferenceNewTableWithFluentInterface(): void + #[Test] + public function setActionReferenceNewTableAndGetActionReferenceNewTableWithFluentInterface(): void { $trigger = new TriggerObject(); // Verify fluent interface and value update $result = $trigger->setActionReferenceNewTable('new_table'); - self::assertSame($trigger, $result); - self::assertSame('new_table', $trigger->getActionReferenceNewTable()); + static::assertSame($trigger, $result); + static::assertSame('new_table', $trigger->getActionReferenceNewTable()); } - public function testSetActionReferenceOldRowAndGetActionReferenceOldRowWithFluentInterface(): void + #[Test] + public function setActionReferenceOldRowAndGetActionReferenceOldRowWithFluentInterface(): void { $trigger = new TriggerObject(); // Verify fluent interface and value update $result = $trigger->setActionReferenceOldRow('OLD'); - self::assertSame($trigger, $result); - self::assertSame('OLD', $trigger->getActionReferenceOldRow()); + static::assertSame($trigger, $result); + static::assertSame('OLD', $trigger->getActionReferenceOldRow()); } - public function testSetActionReferenceOldTableAndGetActionReferenceOldTableWithFluentInterface(): void + #[Test] + public function setActionReferenceOldTableAndGetActionReferenceOldTableWithFluentInterface(): void { $trigger = new TriggerObject(); // Verify fluent interface and value update $result = $trigger->setActionReferenceOldTable('old_table'); - self::assertSame($trigger, $result); - self::assertSame('old_table', $trigger->getActionReferenceOldTable()); + static::assertSame($trigger, $result); + static::assertSame('old_table', $trigger->getActionReferenceOldTable()); } - public function testSetActionStatementAndGetActionStatementWithFluentInterface(): void + #[Test] + public function setActionStatementAndGetActionStatementWithFluentInterface(): void { $trigger = new TriggerObject(); // Verify fluent interface and value update $result = $trigger->setActionStatement('BEGIN ... END'); - self::assertSame($trigger, $result); - self::assertSame('BEGIN ... END', $trigger->getActionStatement()); + static::assertSame($trigger, $result); + static::assertSame('BEGIN ... END', $trigger->getActionStatement()); } - public function testSetActionTimingAndGetActionTimingWithFluentInterface(): void + #[Test] + public function setActionTimingAndGetActionTimingWithFluentInterface(): void { $trigger = new TriggerObject(); // Verify fluent interface and value update $result = $trigger->setActionTiming('BEFORE'); - self::assertSame($trigger, $result); - self::assertSame('BEFORE', $trigger->getActionTiming()); + static::assertSame($trigger, $result); + static::assertSame('BEFORE', $trigger->getActionTiming()); } - public function testSetCreatedAndGetCreatedWithFluentInterface(): void + #[Test] + public function setCreatedAndGetCreatedWithFluentInterface(): void { $trigger = new TriggerObject(); $dateTime = new DateTime('2025-01-01 12:00:00'); // Verify fluent interface and value update $result = $trigger->setCreated($dateTime); - self::assertSame($trigger, $result); - self::assertSame($dateTime, $trigger->getCreated()); + static::assertSame($trigger, $result); + static::assertSame($dateTime, $trigger->getCreated()); } - public function testSetCreatedWithDifferentDateTime(): void + #[Test] + public function setCreatedWithDifferentDateTime(): void { $trigger = new TriggerObject(); $dateTime1 = new DateTime('2025-01-01 12:00:00'); @@ -180,64 +194,69 @@ public function testSetCreatedWithDifferentDateTime(): void // Set first datetime and verify $trigger->setCreated($dateTime1); - self::assertSame($dateTime1, $trigger->getCreated()); + static::assertSame($dateTime1, $trigger->getCreated()); // Update to second datetime and verify $trigger->setCreated($dateTime2); - self::assertSame($dateTime2, $trigger->getCreated()); + static::assertSame($dateTime2, $trigger->getCreated()); } - public function testSetEventManipulationAndGetEventManipulationWithFluentInterface(): void + #[Test] + public function setEventManipulationAndGetEventManipulationWithFluentInterface(): void { $trigger = new TriggerObject(); // Verify fluent interface and value update $result = $trigger->setEventManipulation('INSERT'); - self::assertSame($trigger, $result); - self::assertSame('INSERT', $trigger->getEventManipulation()); + static::assertSame($trigger, $result); + static::assertSame('INSERT', $trigger->getEventManipulation()); } - public function testSetEventObjectCatalogAndGetEventObjectCatalogWithFluentInterface(): void + #[Test] + public function setEventObjectCatalogAndGetEventObjectCatalogWithFluentInterface(): void { $trigger = new TriggerObject(); // Verify fluent interface and value update $result = $trigger->setEventObjectCatalog('catalog_name'); - self::assertSame($trigger, $result); - self::assertSame('catalog_name', $trigger->getEventObjectCatalog()); + static::assertSame($trigger, $result); + static::assertSame('catalog_name', $trigger->getEventObjectCatalog()); } - public function testSetEventObjectSchemaAndGetEventObjectSchemaWithFluentInterface(): void + #[Test] + public function setEventObjectSchemaAndGetEventObjectSchemaWithFluentInterface(): void { $trigger = new TriggerObject(); // Verify fluent interface and value update $result = $trigger->setEventObjectSchema('schema_name'); - self::assertSame($trigger, $result); - self::assertSame('schema_name', $trigger->getEventObjectSchema()); + static::assertSame($trigger, $result); + static::assertSame('schema_name', $trigger->getEventObjectSchema()); } - public function testSetEventObjectTableAndGetEventObjectTableWithFluentInterface(): void + #[Test] + public function setEventObjectTableAndGetEventObjectTableWithFluentInterface(): void { $trigger = new TriggerObject(); // Verify fluent interface and value update $result = $trigger->setEventObjectTable('table_name'); - self::assertSame($trigger, $result); - self::assertSame('table_name', $trigger->getEventObjectTable()); + static::assertSame($trigger, $result); + static::assertSame('table_name', $trigger->getEventObjectTable()); } - public function testSetNameAndGetNameWithFluentInterface(): void + #[Test] + public function setNameAndGetNameWithFluentInterface(): void { $trigger = new TriggerObject(); // Verify fluent interface and value update $result = $trigger->setName('trigger_name'); - self::assertSame($trigger, $result); - self::assertSame('trigger_name', $trigger->getName()); + static::assertSame($trigger, $result); + static::assertSame('trigger_name', $trigger->getName()); // Verify mutation with different name $trigger->setName('updated_trigger'); - self::assertSame('updated_trigger', $trigger->getName()); + static::assertSame('updated_trigger', $trigger->getName()); } } diff --git a/test/unit/Metadata/Object/ViewObjectTest.php b/test/unit/Metadata/Object/ViewObjectTest.php index e00fc531..ddb4de70 100644 --- a/test/unit/Metadata/Object/ViewObjectTest.php +++ b/test/unit/Metadata/Object/ViewObjectTest.php @@ -8,11 +8,13 @@ use PhpDb\Metadata\Object\ColumnObject; use PhpDb\Metadata\Object\ConstraintObject; use PhpDb\Metadata\Object\ViewObject; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; final class ViewObjectTest extends TestCase { - public function testCompleteViewObjectWithAllProperties(): void + #[Test] + public function completeViewObjectWithAllProperties(): void { $view = new ViewObject('active_users'); @@ -29,39 +31,43 @@ public function testCompleteViewObjectWithAllProperties(): void $view->setColumns($columns); // Verify all properties are set correctly - self::assertSame('active_users', $view->getName()); - self::assertSame($definition, $view->getViewDefinition()); - self::assertSame('CASCADED', $view->getCheckOption()); - self::assertFalse($view->isUpdatable()); - self::assertFalse($view->getIsUpdatable()); - self::assertCount(3, $view->getColumns()); + static::assertSame('active_users', $view->getName()); + static::assertSame($definition, $view->getViewDefinition()); + static::assertSame('CASCADED', $view->getCheckOption()); + static::assertFalse($view->isUpdatable()); + static::assertFalse($view->getIsUpdatable()); + static::assertCount(3, $view->getColumns()); } - public function testConstructorWithName(): void + #[Test] + public function constructorWithName(): void { $view = new ViewObject('user_summary'); // Verify name is set by constructor - self::assertSame('user_summary', $view->getName()); + static::assertSame('user_summary', $view->getName()); } - public function testConstructorWithNullName(): void + #[Test] + public function constructorWithNullName(): void { $view = new ViewObject(); // Verify name defaults to null when not provided - self::assertNull($view->getName()); + static::assertNull($view->getName()); } - public function testExtendsAbstractTableObject(): void + #[Test] + public function extendsAbstractTableObject(): void { $view = new ViewObject('view_name'); // Verify view extends AbstractTableObject - self::assertInstanceOf(AbstractTableObject::class, $view); + static::assertInstanceOf(AbstractTableObject::class, $view); } - public function testInheritedColumnsWork(): void + #[Test] + public function inheritedColumnsWork(): void { $view = new ViewObject('user_summary'); $columns = [ @@ -71,11 +77,12 @@ public function testInheritedColumnsWork(): void // Verify inherited setColumns method stores columns $view->setColumns($columns); - self::assertSame($columns, $view->getColumns()); - self::assertCount(2, $view->getColumns()); + static::assertSame($columns, $view->getColumns()); + static::assertCount(2, $view->getColumns()); } - public function testInheritedConstraintsWork(): void + #[Test] + public function inheritedConstraintsWork(): void { $view = new ViewObject('user_summary'); $constraints = [ @@ -84,122 +91,133 @@ public function testInheritedConstraintsWork(): void // Verify inherited setConstraints method stores constraints $view->setConstraints($constraints); - self::assertSame($constraints, $view->getConstraints()); - self::assertCount(1, $view->getConstraints()); + static::assertSame($constraints, $view->getConstraints()); + static::assertCount(1, $view->getConstraints()); } - public function testIsUpdatableAlias(): void + #[Test] + public function isUpdatableAlias(): void { $view = new ViewObject('view'); // Verify alias returns same value when true $view->setIsUpdatable(true); - self::assertTrue($view->isUpdatable()); - self::assertSame($view->getIsUpdatable(), $view->isUpdatable()); + static::assertTrue($view->isUpdatable()); + static::assertSame($view->getIsUpdatable(), $view->isUpdatable()); // Verify alias returns same value when false $view->setIsUpdatable(false); - self::assertFalse($view->isUpdatable()); - self::assertSame($view->getIsUpdatable(), $view->isUpdatable()); + static::assertFalse($view->isUpdatable()); + static::assertSame($view->getIsUpdatable(), $view->isUpdatable()); } - public function testIsUpdatableAliasWithNull(): void + #[Test] + public function isUpdatableAliasWithNull(): void { $view = new ViewObject('view'); // Verify alias returns same value when null $view->setIsUpdatable(null); - self::assertNull($view->isUpdatable()); - self::assertSame($view->getIsUpdatable(), $view->isUpdatable()); + static::assertNull($view->isUpdatable()); + static::assertSame($view->getIsUpdatable(), $view->isUpdatable()); } - public function testSetCheckOptionAndGetCheckOptionWithFluentInterface(): void + #[Test] + public function setCheckOptionAndGetCheckOptionWithFluentInterface(): void { $view = new ViewObject('view'); // Verify fluent interface and value update $result = $view->setCheckOption('CASCADED'); - self::assertSame($view, $result); - self::assertSame('CASCADED', $view->getCheckOption()); + static::assertSame($view, $result); + static::assertSame('CASCADED', $view->getCheckOption()); } - public function testSetCheckOptionWithNull(): void + #[Test] + public function setCheckOptionWithNull(): void { $view = new ViewObject('view'); $view->setCheckOption('LOCAL'); // Set check option to null and verify $view->setCheckOption(null); - self::assertNull($view->getCheckOption()); + static::assertNull($view->getCheckOption()); } - public function testSetIsUpdatableAndGetIsUpdatableWithFluentInterface(): void + #[Test] + public function setIsUpdatableAndGetIsUpdatableWithFluentInterface(): void { $view = new ViewObject('view'); // Verify fluent interface and value update $result = $view->setIsUpdatable(true); - self::assertSame($view, $result); - self::assertTrue($view->getIsUpdatable()); + static::assertSame($view, $result); + static::assertTrue($view->getIsUpdatable()); } - public function testSetIsUpdatableWithFalse(): void + #[Test] + public function setIsUpdatableWithFalse(): void { $view = new ViewObject('view'); // Set updatable to false and verify $view->setIsUpdatable(false); - self::assertFalse($view->getIsUpdatable()); + static::assertFalse($view->getIsUpdatable()); } - public function testSetIsUpdatableWithNull(): void + #[Test] + public function setIsUpdatableWithNull(): void { $view = new ViewObject('view'); $view->setIsUpdatable(true); // Set updatable to null and verify $view->setIsUpdatable(null); - self::assertNull($view->getIsUpdatable()); + static::assertNull($view->getIsUpdatable()); } - public function testSetViewDefinitionAndGetViewDefinitionWithFluentInterface(): void + #[Test] + public function setViewDefinitionAndGetViewDefinitionWithFluentInterface(): void { $view = new ViewObject('view'); $definition = 'SELECT id, name FROM users WHERE active = 1'; // Verify fluent interface and value update $result = $view->setViewDefinition($definition); - self::assertSame($view, $result); - self::assertSame($definition, $view->getViewDefinition()); + static::assertSame($view, $result); + static::assertSame($definition, $view->getViewDefinition()); } - public function testSetViewDefinitionWithNull(): void + #[Test] + public function setViewDefinitionWithNull(): void { $view = new ViewObject('view'); $view->setViewDefinition('SELECT * FROM table'); // Set definition to null and verify $view->setViewDefinition(null); - self::assertNull($view->getViewDefinition()); + static::assertNull($view->getViewDefinition()); } - public function testViewObjectWithInheritedSetName(): void + #[Test] + public function viewObjectWithInheritedSetName(): void { $view = new ViewObject('initial_view'); // Verify inherited setName method updates the name $view->setName('renamed_view'); - self::assertSame('renamed_view', $view->getName()); + static::assertSame('renamed_view', $view->getName()); } - public function testViewObjectWithNullProperties(): void + #[Test] + public function viewObjectWithNullProperties(): void { $view = new ViewObject('simple_view'); // Verify all properties default to null - self::assertNull($view->getViewDefinition()); - self::assertNull($view->getCheckOption()); - self::assertNull($view->getIsUpdatable()); - self::assertNull($view->isUpdatable()); + static::assertNull($view->getViewDefinition()); + static::assertNull($view->getCheckOption()); + static::assertNull($view->getIsUpdatable()); + static::assertNull($view->isUpdatable()); } } diff --git a/test/unit/Metadata/Source/AbstractSourceTest.php b/test/unit/Metadata/Source/AbstractSourceTest.php index 23ffd5d8..0dc82b30 100644 --- a/test/unit/Metadata/Source/AbstractSourceTest.php +++ b/test/unit/Metadata/Source/AbstractSourceTest.php @@ -20,6 +20,7 @@ use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\IgnoreDeprecations; use PHPUnit\Framework\Attributes\RequiresPhp; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use ReflectionException; @@ -58,7 +59,8 @@ final class AbstractSourceTest extends TestCase /** * @throws ReflectionException */ - public function testConstructorWithNullSchemaUsesDefaultConstant(): void + #[Test] + public function constructorWithNullSchemaUsesDefaultConstant(): void { $adapter = $this->createMockForIntersectionOfInterfaces([AdapterInterface::class, SchemaAwareInterface::class]); $adapter->method('getCurrentSchema')->willReturn(false); @@ -71,13 +73,14 @@ public function testConstructorWithNullSchemaUsesDefaultConstant(): void $refProp = new ReflectionProperty($source, 'defaultSchema'); // Verify default constant is used when adapter returns false - self::assertSame(AbstractSource::DEFAULT_SCHEMA, $refProp->getValue($source)); + static::assertSame(AbstractSource::DEFAULT_SCHEMA, $refProp->getValue($source)); } /** * @throws ReflectionException */ - public function testConstructorWithSchemaFromAdapter(): void + #[Test] + public function constructorWithSchemaFromAdapter(): void { $adapter = $this->createMockForIntersectionOfInterfaces([AdapterInterface::class, SchemaAwareInterface::class]); $adapter->method('getCurrentSchema')->willReturn('my_schema'); @@ -90,14 +93,15 @@ public function testConstructorWithSchemaFromAdapter(): void $refProp = new ReflectionProperty($source, 'defaultSchema'); // Verify schema is retrieved from adapter - self::assertSame('my_schema', $refProp->getValue($source)); + static::assertSame('my_schema', $refProp->getValue($source)); } /** * @throws ReflectionException * @throws Exception */ - public function testGetColumn(): void + #[Test] + public function getColumn(): void { $this->setMockData([ 'columns' => [ @@ -123,20 +127,20 @@ public function testGetColumn(): void $column = $this->abstractSourceMock->getColumn('username', 'users', 'public'); // Verify getColumn returns ColumnObject with all properties - self::assertInstanceOf(ColumnObject::class, $column); - self::assertSame('username', $column->getName()); - self::assertSame('users', $column->getTableName()); - self::assertSame('public', $column->getSchemaName()); - self::assertSame(2, $column->getOrdinalPosition()); - self::assertSame('', $column->getColumnDefault()); - self::assertFalse($column->getIsNullable()); - self::assertSame('VARCHAR', $column->getDataType()); - self::assertSame(255, $column->getCharacterMaximumLength()); - self::assertSame(1024, $column->getCharacterOctetLength()); - self::assertNull($column->getNumericPrecision()); - self::assertNull($column->getNumericScale()); - self::assertNull($column->getNumericUnsigned()); - self::assertSame('utf8_general_ci', $column->getErrata('collation')); + static::assertInstanceOf(ColumnObject::class, $column); + static::assertSame('username', $column->getName()); + static::assertSame('users', $column->getTableName()); + static::assertSame('public', $column->getSchemaName()); + static::assertSame(2, $column->getOrdinalPosition()); + static::assertSame('', $column->getColumnDefault()); + static::assertFalse($column->getIsNullable()); + static::assertSame('VARCHAR', $column->getDataType()); + static::assertSame(255, $column->getCharacterMaximumLength()); + static::assertSame(1024, $column->getCharacterOctetLength()); + static::assertNull($column->getNumericPrecision()); + static::assertNull($column->getNumericScale()); + static::assertNull($column->getNumericUnsigned()); + static::assertSame('utf8_general_ci', $column->getErrata('collation')); } /** @@ -145,7 +149,8 @@ public function testGetColumn(): void * @throws ReflectionException * @throws Exception */ - public function testGetColumnNames(): void + #[Test] + public function getColumnNames(): void { $this->setMockData([ 'columns' => [ @@ -162,10 +167,11 @@ public function testGetColumnNames(): void $columnNames = $this->abstractSourceMock->getColumnNames('users', 'public'); // Verify getColumnNames returns array of column names - self::assertSame(['id', 'username', 'email'], $columnNames); + static::assertSame(['id', 'username', 'email'], $columnNames); } - public function testGetColumnNamesThrowsWhenLoadColumnDataDoesNotPopulate(): void + #[Test] + public function getColumnNamesThrowsWhenLoadColumnDataDoesNotPopulate(): void { $adapter = $this->createMockForIntersectionOfInterfaces([ AdapterInterface::class, @@ -183,7 +189,8 @@ public function testGetColumnNamesThrowsWhenLoadColumnDataDoesNotPopulate(): voi /** * @throws ReflectionException */ - public function testGetColumnNamesUsesDefaultSchemaWhenNull(): void + #[Test] + public function getColumnNamesUsesDefaultSchemaWhenNull(): void { $refProp = new ReflectionProperty($this->abstractSourceMock, 'defaultSchema'); $refProp->setValue($this->abstractSourceMock, 'def'); @@ -201,13 +208,14 @@ public function testGetColumnNamesUsesDefaultSchemaWhenNull(): void $names = $this->abstractSourceMock->getColumnNames('users', null); - self::assertSame(['id', 'name'], $names); + static::assertSame(['id', 'name'], $names); } /** * @throws ReflectionException */ - public function testGetColumns(): void + #[Test] + public function getColumns(): void { $this->setMockData([ 'columns' => [ @@ -233,15 +241,16 @@ public function testGetColumns(): void $columns = $this->abstractSourceMock->getColumns('users', 'public'); // Verify getColumns returns array of ColumnObject instances - self::assertCount(1, $columns); - self::assertInstanceOf(ColumnObject::class, $columns[0]); - self::assertSame('id', $columns[0]->getName()); + static::assertCount(1, $columns); + static::assertInstanceOf(ColumnObject::class, $columns[0]); + static::assertSame('id', $columns[0]->getName()); } /** * @throws ReflectionException */ - public function testGetColumnsUsesDefaultSchemaWhenNull(): void + #[Test] + public function getColumnsUsesDefaultSchemaWhenNull(): void { $refProp = new ReflectionProperty($this->abstractSourceMock, 'defaultSchema'); $refProp->setValue($this->abstractSourceMock, 'def'); @@ -269,14 +278,15 @@ public function testGetColumnsUsesDefaultSchemaWhenNull(): void $columns = $this->abstractSourceMock->getColumns('users', null); - self::assertCount(1, $columns); - self::assertInstanceOf(ColumnObject::class, $columns[0]); + static::assertCount(1, $columns); + static::assertInstanceOf(ColumnObject::class, $columns[0]); } /** * @throws ReflectionException */ - public function testGetColumnThrowsExceptionForNonExistentColumn(): void + #[Test] + public function getColumnThrowsExceptionForNonExistentColumn(): void { $this->setMockData([ 'columns' => [ @@ -297,7 +307,8 @@ public function testGetColumnThrowsExceptionForNonExistentColumn(): void /** * @throws ReflectionException */ - public function testGetColumnUsesDefaultSchemaWhenNull(): void + #[Test] + public function getColumnUsesDefaultSchemaWhenNull(): void { $refProp = new ReflectionProperty($this->abstractSourceMock, 'defaultSchema'); $refProp->setValue($this->abstractSourceMock, 'def'); @@ -325,14 +336,15 @@ public function testGetColumnUsesDefaultSchemaWhenNull(): void $column = $this->abstractSourceMock->getColumn('id', 'users', null); - self::assertInstanceOf(ColumnObject::class, $column); + static::assertInstanceOf(ColumnObject::class, $column); } /** * @throws ReflectionException * @throws Exception */ - public function testGetConstraint(): void + #[Test] + public function getConstraint(): void { $this->setMockData([ 'constraints' => [ @@ -356,18 +368,18 @@ public function testGetConstraint(): void $constraint = $this->abstractSourceMock->getConstraint('fk_orders_user', 'orders', 'public'); // Verify getConstraint returns ConstraintObject with all properties - self::assertInstanceOf(ConstraintObject::class, $constraint); - self::assertSame('fk_orders_user', $constraint->getName()); - self::assertSame('orders', $constraint->getTableName()); - self::assertSame('public', $constraint->getSchemaName()); - self::assertSame('FOREIGN KEY', $constraint->getType()); - self::assertSame(['user_id'], $constraint->getColumns()); - self::assertSame('public', $constraint->getReferencedTableSchema()); - self::assertSame('users', $constraint->getReferencedTableName()); - self::assertSame(['id'], $constraint->getReferencedColumns()); - self::assertSame('SIMPLE', $constraint->getMatchOption()); - self::assertSame('CASCADE', $constraint->getUpdateRule()); - self::assertSame('RESTRICT', $constraint->getDeleteRule()); + static::assertInstanceOf(ConstraintObject::class, $constraint); + static::assertSame('fk_orders_user', $constraint->getName()); + static::assertSame('orders', $constraint->getTableName()); + static::assertSame('public', $constraint->getSchemaName()); + static::assertSame('FOREIGN KEY', $constraint->getType()); + static::assertSame(['user_id'], $constraint->getColumns()); + static::assertSame('public', $constraint->getReferencedTableSchema()); + static::assertSame('users', $constraint->getReferencedTableName()); + static::assertSame(['id'], $constraint->getReferencedColumns()); + static::assertSame('SIMPLE', $constraint->getMatchOption()); + static::assertSame('CASCADE', $constraint->getUpdateRule()); + static::assertSame('RESTRICT', $constraint->getDeleteRule()); } /** @@ -375,7 +387,8 @@ public function testGetConstraint(): void * * @throws ReflectionException */ - public function testGetConstraintKeys(): void + #[Test] + public function getConstraintKeys(): void { // internal data $data = [ @@ -405,25 +418,26 @@ public function testGetConstraintKeys(): void $this->setMockData($data); // Verify getConstraintKeys returns ConstraintKeyObject with references $constraints = $this->abstractSourceMock->getConstraintKeys('bam_constraint', 'bar_table', 'foo_schema'); - self::assertCount(1, $constraints); + static::assertCount(1, $constraints); $constraintKeyObj = $constraints[0]; - self::assertInstanceOf(ConstraintKeyObject::class, $constraintKeyObj); + static::assertInstanceOf(ConstraintKeyObject::class, $constraintKeyObj); // check value object is mapped correctly - self::assertEquals('a', $constraintKeyObj->getColumnName()); + static::assertEquals('a', $constraintKeyObj->getColumnName()); // Verify value object is mapped correctly - self::assertEquals(1, $constraintKeyObj->getOrdinalPosition()); - self::assertEquals('another_table', $constraintKeyObj->getReferencedTableName()); - self::assertEquals('another_column', $constraintKeyObj->getReferencedColumnName()); - self::assertEquals('UP', $constraintKeyObj->getForeignKeyUpdateRule()); - self::assertEquals('DOWN', $constraintKeyObj->getForeignKeyDeleteRule()); + static::assertEquals(1, $constraintKeyObj->getOrdinalPosition()); + static::assertEquals('another_table', $constraintKeyObj->getReferencedTableName()); + static::assertEquals('another_column', $constraintKeyObj->getReferencedColumnName()); + static::assertEquals('UP', $constraintKeyObj->getForeignKeyUpdateRule()); + static::assertEquals('DOWN', $constraintKeyObj->getForeignKeyDeleteRule()); } /** * @throws ReflectionException */ - public function testGetConstraintKeysUsesDefaultSchemaWhenNull(): void + #[Test] + public function getConstraintKeysUsesDefaultSchemaWhenNull(): void { $refProp = new ReflectionProperty($this->abstractSourceMock, 'defaultSchema'); $refProp->setValue($this->abstractSourceMock, 'def'); @@ -446,14 +460,15 @@ public function testGetConstraintKeysUsesDefaultSchemaWhenNull(): void $keys = $this->abstractSourceMock->getConstraintKeys('pk', 'users', null); - self::assertCount(1, $keys); - self::assertInstanceOf(ConstraintKeyObject::class, $keys[0]); + static::assertCount(1, $keys); + static::assertInstanceOf(ConstraintKeyObject::class, $keys[0]); } /** * @throws ReflectionException */ - public function testGetConstraintKeysWithMultipleKeys(): void + #[Test] + public function getConstraintKeysWithMultipleKeys(): void { $data = [ 'constraint_references' => [ @@ -489,15 +504,16 @@ public function testGetConstraintKeysWithMultipleKeys(): void // Verify composite constraint keys are returned in order $keys = $this->abstractSourceMock->getConstraintKeys('fk_composite', 'my_table', 'public'); - self::assertCount(2, $keys); - self::assertSame('col1', $keys[0]->getColumnName()); - self::assertSame('col2', $keys[1]->getColumnName()); + static::assertCount(2, $keys); + static::assertSame('col1', $keys[0]->getColumnName()); + static::assertSame('col2', $keys[1]->getColumnName()); } /** * @throws ReflectionException */ - public function testGetConstraintKeysWithoutReferences(): void + #[Test] + public function getConstraintKeysWithoutReferences(): void { $data = [ 'constraint_references' => [ @@ -519,9 +535,9 @@ public function testGetConstraintKeysWithoutReferences(): void // Verify constraint keys without references have null references $keys = $this->abstractSourceMock->getConstraintKeys('pk_users', 'users', 'public'); - self::assertCount(1, $keys); - self::assertSame('id', $keys[0]->getColumnName()); - self::assertNull($keys[0]->getReferencedTableName()); + static::assertCount(1, $keys); + static::assertSame('id', $keys[0]->getColumnName()); + static::assertNull($keys[0]->getReferencedTableName()); } /** @@ -529,7 +545,8 @@ public function testGetConstraintKeysWithoutReferences(): void * * @throws ReflectionException */ - public function testGetConstraints(): void + #[Test] + public function getConstraints(): void { $this->setMockData([ 'constraints' => [ @@ -551,15 +568,16 @@ public function testGetConstraints(): void $constraints = $this->abstractSourceMock->getConstraints('users', 'public'); // Verify getConstraints returns array of ConstraintObject instances - self::assertCount(2, $constraints); - self::assertInstanceOf(ConstraintObject::class, $constraints[0]); - self::assertInstanceOf(ConstraintObject::class, $constraints[1]); + static::assertCount(2, $constraints); + static::assertInstanceOf(ConstraintObject::class, $constraints[0]); + static::assertInstanceOf(ConstraintObject::class, $constraints[1]); } /** * @throws ReflectionException */ - public function testGetConstraintsUsesDefaultSchemaWhenNull(): void + #[Test] + public function getConstraintsUsesDefaultSchemaWhenNull(): void { $refProp = new ReflectionProperty($this->abstractSourceMock, 'defaultSchema'); $refProp->setValue($this->abstractSourceMock, 'def'); @@ -579,13 +597,14 @@ public function testGetConstraintsUsesDefaultSchemaWhenNull(): void $constraints = $this->abstractSourceMock->getConstraints('users', null); - self::assertCount(1, $constraints); + static::assertCount(1, $constraints); } /** * @throws ReflectionException */ - public function testGetConstraintThrowsExceptionForNonExistent(): void + #[Test] + public function getConstraintThrowsExceptionForNonExistent(): void { $this->setMockData([ 'constraints' => [ @@ -606,7 +625,8 @@ public function testGetConstraintThrowsExceptionForNonExistent(): void /** * @throws ReflectionException */ - public function testGetConstraintUsesDefaultSchemaWhenNull(): void + #[Test] + public function getConstraintUsesDefaultSchemaWhenNull(): void { $refProp = new ReflectionProperty($this->abstractSourceMock, 'defaultSchema'); $refProp->setValue($this->abstractSourceMock, 'def'); @@ -626,14 +646,15 @@ public function testGetConstraintUsesDefaultSchemaWhenNull(): void $constraint = $this->abstractSourceMock->getConstraint('pk', 'users', null); - self::assertInstanceOf(ConstraintObject::class, $constraint); + static::assertInstanceOf(ConstraintObject::class, $constraint); } /** * @throws ReflectionException * @throws Exception */ - public function testGetConstraintWithCheckClause(): void + #[Test] + public function getConstraintWithCheckClause(): void { $this->setMockData([ 'constraints' => [ @@ -651,8 +672,8 @@ public function testGetConstraintWithCheckClause(): void $constraint = $this->abstractSourceMock->getConstraint('chk_age', 'users', 'public'); // Verify getConstraint returns constraint with check clause - self::assertSame('CHECK', $constraint->getType()); - self::assertSame('age >= 18', $constraint->getCheckClause()); + static::assertSame('CHECK', $constraint->getType()); + static::assertSame('age >= 18', $constraint->getCheckClause()); } /** @@ -660,7 +681,8 @@ public function testGetConstraintWithCheckClause(): void * * @throws ReflectionException */ - public function testGetSchemasCallsLoadSchemaData(): void + #[Test] + public function getSchemasCallsLoadSchemaData(): void { $this->abstractSourceMock->expects($this->once())->method('loadSchemaData'); @@ -668,14 +690,15 @@ public function testGetSchemasCallsLoadSchemaData(): void // Verify getSchemas loads and returns schema list $schemas = $this->abstractSourceMock->getSchemas(); - self::assertSame(['schema1', 'schema2'], $schemas); + static::assertSame(['schema1', 'schema2'], $schemas); } /** * @throws ReflectionException * @throws Exception */ - public function testGetTableForBaseTable(): void + #[Test] + public function getTableForBaseTable(): void { $this->setMockData([ 'table_names' => [ @@ -698,15 +721,16 @@ public function testGetTableForBaseTable(): void // Verify getTable returns TableObject for base table $table = $this->abstractSourceMock->getTable('users', 'public'); - self::assertInstanceOf(TableObject::class, $table); - self::assertSame('users', $table->getName()); + static::assertInstanceOf(TableObject::class, $table); + static::assertSame('users', $table->getName()); } /** * @throws ReflectionException * @throws Exception */ - public function testGetTableForView(): void + #[Test] + public function getTableForView(): void { $this->setMockData([ 'table_names' => [ @@ -734,17 +758,18 @@ public function testGetTableForView(): void $view = $this->abstractSourceMock->getTable('user_summary', 'public'); // Verify getTable returns ViewObject for view type - self::assertInstanceOf(ViewObject::class, $view); - self::assertSame('user_summary', $view->getName()); - self::assertSame('SELECT id, name FROM users', $view->getViewDefinition()); - self::assertSame('CASCADED', $view->getCheckOption()); - self::assertFalse($view->getIsUpdatable()); + static::assertInstanceOf(ViewObject::class, $view); + static::assertSame('user_summary', $view->getName()); + static::assertSame('SELECT id, name FROM users', $view->getViewDefinition()); + static::assertSame('CASCADED', $view->getCheckOption()); + static::assertFalse($view->getIsUpdatable()); } /** * @throws ReflectionException */ - public function testGetTableNamesExcludesViewsByDefault(): void + #[Test] + public function getTableNamesExcludesViewsByDefault(): void { $this->setMockData([ 'table_names' => [ @@ -759,13 +784,14 @@ public function testGetTableNamesExcludesViewsByDefault(): void // Verify views are excluded by default $tableNames = $this->abstractSourceMock->getTableNames('public'); - self::assertSame(['users', 'orders'], $tableNames); + static::assertSame(['users', 'orders'], $tableNames); } /** * @throws ReflectionException */ - public function testGetTableNamesIncludesViewsWhenRequested(): void + #[Test] + public function getTableNamesIncludesViewsWhenRequested(): void { $this->setMockData([ 'table_names' => [ @@ -779,7 +805,7 @@ public function testGetTableNamesIncludesViewsWhenRequested(): void // Verify views are included when flag is true $tableNames = $this->abstractSourceMock->getTableNames('public', true); - self::assertSame(['users', 'user_summary'], $tableNames); + static::assertSame(['users', 'user_summary'], $tableNames); } /** @@ -788,7 +814,8 @@ public function testGetTableNamesIncludesViewsWhenRequested(): void * @throws ReflectionException * @throws ReflectionException */ - public function testGetTableNamesWithNullSchemaUsesDefault(): void + #[Test] + public function getTableNamesWithNullSchemaUsesDefault(): void { $refProp = new ReflectionProperty($this->abstractSourceMock, 'defaultSchema'); $refProp->setValue($this->abstractSourceMock, 'default_schema'); @@ -805,13 +832,14 @@ public function testGetTableNamesWithNullSchemaUsesDefault(): void // Verify default schema is used when none provided $tableNames = $this->abstractSourceMock->getTableNames(); - self::assertSame(['users', 'orders'], $tableNames); + static::assertSame(['users', 'orders'], $tableNames); } /** * @throws ReflectionException */ - public function testGetTableNamesWithSpecificSchema(): void + #[Test] + public function getTableNamesWithSpecificSchema(): void { $this->setMockData([ 'table_names' => [ @@ -824,7 +852,7 @@ public function testGetTableNamesWithSpecificSchema(): void // Verify table names for specific schema $tableNames = $this->abstractSourceMock->getTableNames('public'); - self::assertSame(['products'], $tableNames); + static::assertSame(['products'], $tableNames); } /** @@ -832,7 +860,8 @@ public function testGetTableNamesWithSpecificSchema(): void * * @throws ReflectionException */ - public function testGetTables(): void + #[Test] + public function getTables(): void { $this->setMockData([ 'table_names' => [ @@ -858,15 +887,16 @@ public function testGetTables(): void // Verify getTables returns array of TableObject instances $tables = $this->abstractSourceMock->getTables('public'); - self::assertCount(2, $tables); - self::assertInstanceOf(TableObject::class, $tables[0]); - self::assertInstanceOf(TableObject::class, $tables[1]); + static::assertCount(2, $tables); + static::assertInstanceOf(TableObject::class, $tables[0]); + static::assertInstanceOf(TableObject::class, $tables[1]); } /** * @throws ReflectionException */ - public function testGetTablesUsesDefaultSchemaWhenNull(): void + #[Test] + public function getTablesUsesDefaultSchemaWhenNull(): void { $refProp = new ReflectionProperty($this->abstractSourceMock, 'defaultSchema'); $refProp->setValue($this->abstractSourceMock, 'def'); @@ -891,14 +921,15 @@ public function testGetTablesUsesDefaultSchemaWhenNull(): void $tables = $this->abstractSourceMock->getTables(null); - self::assertCount(1, $tables); - self::assertInstanceOf(TableObject::class, $tables[0]); + static::assertCount(1, $tables); + static::assertInstanceOf(TableObject::class, $tables[0]); } /** * @throws ReflectionException */ - public function testGetTableThrowsExceptionForNonExistentTable(): void + #[Test] + public function getTableThrowsExceptionForNonExistentTable(): void { $this->setMockData([ 'table_names' => [ @@ -917,7 +948,8 @@ public function testGetTableThrowsExceptionForNonExistentTable(): void /** * @throws ReflectionException */ - public function testGetTableThrowsExceptionForUnsupportedTableType(): void + #[Test] + public function getTableThrowsExceptionForUnsupportedTableType(): void { $this->setMockData([ 'table_names' => [ @@ -938,7 +970,8 @@ public function testGetTableThrowsExceptionForUnsupportedTableType(): void /** * @throws ReflectionException */ - public function testGetTableUsesDefaultSchemaWhenNull(): void + #[Test] + public function getTableUsesDefaultSchemaWhenNull(): void { $refProp = new ReflectionProperty($this->abstractSourceMock, 'defaultSchema'); $refProp->setValue($this->abstractSourceMock, 'def'); @@ -963,14 +996,15 @@ public function testGetTableUsesDefaultSchemaWhenNull(): void $table = $this->abstractSourceMock->getTable('users', null); - self::assertInstanceOf(TableObject::class, $table); + static::assertInstanceOf(TableObject::class, $table); } /** * @throws ReflectionException * @throws Exception */ - public function testGetTrigger(): void + #[Test] + public function getTrigger(): void { $this->setMockData([ 'triggers' => [ @@ -998,22 +1032,22 @@ public function testGetTrigger(): void $trigger = $this->abstractSourceMock->getTrigger('my_trigger', 'public'); // Verify getTrigger returns TriggerObject with all properties - self::assertInstanceOf(TriggerObject::class, $trigger); - self::assertSame('my_trigger', $trigger->getName()); - self::assertSame('UPDATE', $trigger->getEventManipulation()); - self::assertSame('main', $trigger->getEventObjectCatalog()); - self::assertSame('public', $trigger->getEventObjectSchema()); - self::assertSame('orders', $trigger->getEventObjectTable()); - self::assertSame('1', $trigger->getActionOrder()); - self::assertSame('WHEN (NEW.status != OLD.status)', $trigger->getActionCondition()); - self::assertSame('EXECUTE PROCEDURE log_change()', $trigger->getActionStatement()); - self::assertSame('ROW', $trigger->getActionOrientation()); - self::assertSame('AFTER', $trigger->getActionTiming()); - self::assertSame('old_table', $trigger->getActionReferenceOldTable()); - self::assertSame('new_table', $trigger->getActionReferenceNewTable()); - self::assertSame('OLD', $trigger->getActionReferenceOldRow()); - self::assertSame('NEW', $trigger->getActionReferenceNewRow()); - self::assertNull($trigger->getCreated()); + static::assertInstanceOf(TriggerObject::class, $trigger); + static::assertSame('my_trigger', $trigger->getName()); + static::assertSame('UPDATE', $trigger->getEventManipulation()); + static::assertSame('main', $trigger->getEventObjectCatalog()); + static::assertSame('public', $trigger->getEventObjectSchema()); + static::assertSame('orders', $trigger->getEventObjectTable()); + static::assertSame('1', $trigger->getActionOrder()); + static::assertSame('WHEN (NEW.status != OLD.status)', $trigger->getActionCondition()); + static::assertSame('EXECUTE PROCEDURE log_change()', $trigger->getActionStatement()); + static::assertSame('ROW', $trigger->getActionOrientation()); + static::assertSame('AFTER', $trigger->getActionTiming()); + static::assertSame('old_table', $trigger->getActionReferenceOldTable()); + static::assertSame('new_table', $trigger->getActionReferenceNewTable()); + static::assertSame('OLD', $trigger->getActionReferenceOldRow()); + static::assertSame('NEW', $trigger->getActionReferenceNewRow()); + static::assertNull($trigger->getCreated()); } /** @@ -1021,7 +1055,8 @@ public function testGetTrigger(): void * * @throws ReflectionException */ - public function testGetTriggerNames(): void + #[Test] + public function getTriggerNames(): void { $this->setMockData([ 'triggers' => [ @@ -1035,13 +1070,14 @@ public function testGetTriggerNames(): void $triggerNames = $this->abstractSourceMock->getTriggerNames('public'); // Verify getTriggerNames returns array of trigger names - self::assertSame(['audit_trigger', 'update_timestamp'], $triggerNames); + static::assertSame(['audit_trigger', 'update_timestamp'], $triggerNames); } /** * @throws ReflectionException */ - public function testGetTriggerNamesUsesDefaultSchemaWhenNull(): void + #[Test] + public function getTriggerNamesUsesDefaultSchemaWhenNull(): void { $refProp = new ReflectionProperty($this->abstractSourceMock, 'defaultSchema'); $refProp->setValue($this->abstractSourceMock, 'def'); @@ -1056,13 +1092,14 @@ public function testGetTriggerNamesUsesDefaultSchemaWhenNull(): void $names = $this->abstractSourceMock->getTriggerNames(null); - self::assertSame(['trig1'], $names); + static::assertSame(['trig1'], $names); } /** * @throws ReflectionException */ - public function testGetTriggers(): void + #[Test] + public function getTriggers(): void { $this->setMockData([ 'triggers' => [ @@ -1090,14 +1127,15 @@ public function testGetTriggers(): void $triggers = $this->abstractSourceMock->getTriggers('public'); // Verify getTriggers returns array of TriggerObject instances - self::assertCount(1, $triggers); - self::assertInstanceOf(TriggerObject::class, $triggers[0]); + static::assertCount(1, $triggers); + static::assertInstanceOf(TriggerObject::class, $triggers[0]); } /** * @throws ReflectionException */ - public function testGetTriggersUsesDefaultSchemaWhenNull(): void + #[Test] + public function getTriggersUsesDefaultSchemaWhenNull(): void { $refProp = new ReflectionProperty($this->abstractSourceMock, 'defaultSchema'); $refProp->setValue($this->abstractSourceMock, 'def'); @@ -1127,14 +1165,15 @@ public function testGetTriggersUsesDefaultSchemaWhenNull(): void $triggers = $this->abstractSourceMock->getTriggers(null); - self::assertCount(1, $triggers); - self::assertInstanceOf(TriggerObject::class, $triggers[0]); + static::assertCount(1, $triggers); + static::assertInstanceOf(TriggerObject::class, $triggers[0]); } /** * @throws ReflectionException */ - public function testGetTriggerThrowsExceptionForNonExistent(): void + #[Test] + public function getTriggerThrowsExceptionForNonExistent(): void { $this->setMockData([ 'triggers' => [ @@ -1153,7 +1192,8 @@ public function testGetTriggerThrowsExceptionForNonExistent(): void /** * @throws ReflectionException */ - public function testGetTriggerUsesDefaultSchemaWhenNull(): void + #[Test] + public function getTriggerUsesDefaultSchemaWhenNull(): void { $refProp = new ReflectionProperty($this->abstractSourceMock, 'defaultSchema'); $refProp->setValue($this->abstractSourceMock, 'def'); @@ -1183,15 +1223,16 @@ public function testGetTriggerUsesDefaultSchemaWhenNull(): void $trigger = $this->abstractSourceMock->getTrigger('trig1', null); - self::assertInstanceOf(TriggerObject::class, $trigger); - self::assertSame('trig1', $trigger->getName()); + static::assertInstanceOf(TriggerObject::class, $trigger); + static::assertSame('trig1', $trigger->getName()); } /** * @throws ReflectionException * @throws Exception */ - public function testGetViewForExistingView(): void + #[Test] + public function getViewForExistingView(): void { $this->setMockData([ 'table_names' => [ @@ -1219,8 +1260,8 @@ public function testGetViewForExistingView(): void $view = $this->abstractSourceMock->getView('my_view', 'public'); // Verify getView returns ViewObject with all properties - self::assertInstanceOf(ViewObject::class, $view); - self::assertSame('my_view', $view->getName()); + static::assertInstanceOf(ViewObject::class, $view); + static::assertSame('my_view', $view->getName()); } /** @@ -1228,7 +1269,8 @@ public function testGetViewForExistingView(): void * * @throws ReflectionException */ - public function testGetViewNames(): void + #[Test] + public function getViewNames(): void { $this->setMockData([ 'table_names' => [ @@ -1243,13 +1285,14 @@ public function testGetViewNames(): void $viewNames = $this->abstractSourceMock->getViewNames('public'); // Verify getViewNames filters only view types - self::assertSame(['user_summary', 'order_summary'], $viewNames); + static::assertSame(['user_summary', 'order_summary'], $viewNames); } /** * @throws ReflectionException */ - public function testGetViewNamesUsesDefaultSchemaWhenNull(): void + #[Test] + public function getViewNamesUsesDefaultSchemaWhenNull(): void { $refProp = new ReflectionProperty($this->abstractSourceMock, 'defaultSchema'); $refProp->setValue($this->abstractSourceMock, 'def'); @@ -1264,13 +1307,14 @@ public function testGetViewNamesUsesDefaultSchemaWhenNull(): void $names = $this->abstractSourceMock->getViewNames(null); - self::assertSame(['v1'], $names); + static::assertSame(['v1'], $names); } /** * @throws ReflectionException */ - public function testGetViews(): void + #[Test] + public function getViews(): void { $this->setMockData([ 'table_names' => [ @@ -1298,14 +1342,15 @@ public function testGetViews(): void $views = $this->abstractSourceMock->getViews('public'); // Verify getViews returns array of ViewObject instances - self::assertCount(1, $views); - self::assertInstanceOf(ViewObject::class, $views[0]); + static::assertCount(1, $views); + static::assertInstanceOf(ViewObject::class, $views[0]); } /** * @throws ReflectionException */ - public function testGetViewsUsesDefaultSchemaWhenNull(): void + #[Test] + public function getViewsUsesDefaultSchemaWhenNull(): void { $refProp = new ReflectionProperty($this->abstractSourceMock, 'defaultSchema'); $refProp->setValue($this->abstractSourceMock, 'def'); @@ -1327,13 +1372,14 @@ public function testGetViewsUsesDefaultSchemaWhenNull(): void $views = $this->abstractSourceMock->getViews(null); - self::assertCount(1, $views); + static::assertCount(1, $views); } /** * @throws ReflectionException */ - public function testGetViewThrowsExceptionForNonExistentView(): void + #[Test] + public function getViewThrowsExceptionForNonExistentView(): void { $this->setMockData([ 'table_names' => [ @@ -1352,7 +1398,8 @@ public function testGetViewThrowsExceptionForNonExistentView(): void /** * @throws ReflectionException */ - public function testGetViewThrowsExceptionForTable(): void + #[Test] + public function getViewThrowsExceptionForTable(): void { $this->setMockData([ 'table_names' => [ @@ -1373,7 +1420,8 @@ public function testGetViewThrowsExceptionForTable(): void /** * @throws ReflectionException */ - public function testGetViewUsesDefaultSchemaWhenNull(): void + #[Test] + public function getViewUsesDefaultSchemaWhenNull(): void { $refProp = new ReflectionProperty($this->abstractSourceMock, 'defaultSchema'); $refProp->setValue($this->abstractSourceMock, 'def'); @@ -1395,7 +1443,7 @@ public function testGetViewUsesDefaultSchemaWhenNull(): void $view = $this->abstractSourceMock->getView('v1', null); - self::assertInstanceOf(ViewObject::class, $view); + static::assertInstanceOf(ViewObject::class, $view); } protected MockObject|AbstractSource $abstractSourceMock; @@ -1405,21 +1453,23 @@ public function testGetViewUsesDefaultSchemaWhenNull(): void /** * @throws ReflectionException */ - public function testLoadColumnDataCallsPrepareDataHierarchy(): void + #[Test] + public function loadColumnDataCallsPrepareDataHierarchy(): void { $method = new ReflectionMethod($this->abstractSourceMock, 'loadColumnData'); $method->invoke($this->abstractSourceMock, 'users', 'test_schema'); $data = $this->getMockData(); - self::assertArrayHasKey('columns', $data); - self::assertArrayHasKey('test_schema', $data['columns']); - self::assertArrayHasKey('users', $data['columns']['test_schema']); + static::assertArrayHasKey('columns', $data); + static::assertArrayHasKey('test_schema', $data['columns']); + static::assertArrayHasKey('users', $data['columns']['test_schema']); } /** * @throws ReflectionException */ - public function testLoadColumnDataEarlyReturnWhenDataExists(): void + #[Test] + public function loadColumnDataEarlyReturnWhenDataExists(): void { $this->setMockData([ 'columns' => [ @@ -1434,26 +1484,28 @@ public function testLoadColumnDataEarlyReturnWhenDataExists(): void $data = $this->getMockData(); // Verify method returns early when data exists - self::assertArrayHasKey('existing_column', $data['columns']['public']['users']); + static::assertArrayHasKey('existing_column', $data['columns']['public']['users']); } /** * @throws ReflectionException */ - public function testLoadConstraintDataCallsPrepareDataHierarchy(): void + #[Test] + public function loadConstraintDataCallsPrepareDataHierarchy(): void { $method = new ReflectionMethod($this->abstractSourceMock, 'loadConstraintData'); $method->invoke($this->abstractSourceMock, 'users', 'test_schema'); $data = $this->getMockData(); - self::assertArrayHasKey('constraints', $data); - self::assertArrayHasKey('test_schema', $data['constraints']); + static::assertArrayHasKey('constraints', $data); + static::assertArrayHasKey('test_schema', $data['constraints']); } /** * @throws ReflectionException */ - public function testLoadConstraintDataEarlyReturnWhenDataExists(): void + #[Test] + public function loadConstraintDataEarlyReturnWhenDataExists(): void { $this->setMockData([ 'constraints' => [ @@ -1466,26 +1518,28 @@ public function testLoadConstraintDataEarlyReturnWhenDataExists(): void $data = $this->getMockData(); // Verify method returns early when data exists - self::assertArrayHasKey('existing', $data['constraints']['public']); + static::assertArrayHasKey('existing', $data['constraints']['public']); } /** * @throws ReflectionException */ - public function testLoadConstraintDataKeysCallsPrepareDataHierarchy(): void + #[Test] + public function loadConstraintDataKeysCallsPrepareDataHierarchy(): void { $method = new ReflectionMethod($this->abstractSourceMock, 'loadConstraintDataKeys'); $method->invoke($this->abstractSourceMock, 'test_schema'); $data = $this->getMockData(); - self::assertArrayHasKey('constraint_keys', $data); - self::assertArrayHasKey('test_schema', $data['constraint_keys']); + static::assertArrayHasKey('constraint_keys', $data); + static::assertArrayHasKey('test_schema', $data['constraint_keys']); } /** * @throws ReflectionException */ - public function testLoadConstraintDataKeysEarlyReturnWhenDataExists(): void + #[Test] + public function loadConstraintDataKeysEarlyReturnWhenDataExists(): void { $this->setMockData([ 'constraint_keys' => [ @@ -1498,26 +1552,28 @@ public function testLoadConstraintDataKeysEarlyReturnWhenDataExists(): void $data = $this->getMockData(); // Verify method returns early when data exists - self::assertArrayHasKey('existing', $data['constraint_keys']['public']); + static::assertArrayHasKey('existing', $data['constraint_keys']['public']); } /** * @throws ReflectionException */ - public function testLoadConstraintReferencesCallsPrepareDataHierarchy(): void + #[Test] + public function loadConstraintReferencesCallsPrepareDataHierarchy(): void { $method = new ReflectionMethod($this->abstractSourceMock, 'loadConstraintReferences'); $method->invoke($this->abstractSourceMock, 'users', 'test_schema'); $data = $this->getMockData(); - self::assertArrayHasKey('constraint_references', $data); - self::assertArrayHasKey('test_schema', $data['constraint_references']); + static::assertArrayHasKey('constraint_references', $data); + static::assertArrayHasKey('test_schema', $data['constraint_references']); } /** * @throws ReflectionException */ - public function testLoadConstraintReferencesEarlyReturnWhenDataExists(): void + #[Test] + public function loadConstraintReferencesEarlyReturnWhenDataExists(): void { $this->setMockData([ 'constraint_references' => [ @@ -1530,26 +1586,28 @@ public function testLoadConstraintReferencesEarlyReturnWhenDataExists(): void $data = $this->getMockData(); // Verify method returns early when data exists - self::assertArrayHasKey('existing', $data['constraint_references']['public']); + static::assertArrayHasKey('existing', $data['constraint_references']['public']); } /** * @throws ReflectionException */ - public function testLoadTableNameDataCallsPrepareDataHierarchy(): void + #[Test] + public function loadTableNameDataCallsPrepareDataHierarchy(): void { $method = new ReflectionMethod($this->abstractSourceMock, 'loadTableNameData'); $method->invoke($this->abstractSourceMock, 'test_schema'); $data = $this->getMockData(); - self::assertArrayHasKey('table_names', $data); - self::assertArrayHasKey('test_schema', $data['table_names']); + static::assertArrayHasKey('table_names', $data); + static::assertArrayHasKey('test_schema', $data['table_names']); } /** * @throws ReflectionException */ - public function testLoadTableNameDataEarlyReturnWhenDataExists(): void + #[Test] + public function loadTableNameDataEarlyReturnWhenDataExists(): void { $this->setMockData([ 'table_names' => [ @@ -1562,26 +1620,28 @@ public function testLoadTableNameDataEarlyReturnWhenDataExists(): void $data = $this->getMockData(); // Verify method returns early when data exists - self::assertArrayHasKey('existing', $data['table_names']['public']); + static::assertArrayHasKey('existing', $data['table_names']['public']); } /** * @throws ReflectionException */ - public function testLoadTriggerDataCallsPrepareDataHierarchy(): void + #[Test] + public function loadTriggerDataCallsPrepareDataHierarchy(): void { $method = new ReflectionMethod($this->abstractSourceMock, 'loadTriggerData'); $method->invoke($this->abstractSourceMock, 'test_schema'); $data = $this->getMockData(); - self::assertArrayHasKey('triggers', $data); - self::assertArrayHasKey('test_schema', $data['triggers']); + static::assertArrayHasKey('triggers', $data); + static::assertArrayHasKey('test_schema', $data['triggers']); } /** * @throws ReflectionException */ - public function testLoadTriggerDataEarlyReturnWhenDataExists(): void + #[Test] + public function loadTriggerDataEarlyReturnWhenDataExists(): void { $this->setMockData([ 'triggers' => [ @@ -1594,13 +1654,14 @@ public function testLoadTriggerDataEarlyReturnWhenDataExists(): void $data = $this->getMockData(); // Verify method returns early when data exists - self::assertArrayHasKey('existing', $data['triggers']['public']); + static::assertArrayHasKey('existing', $data['triggers']['public']); } /** * @throws ReflectionException */ - public function testPrepareDataHierarchyWithMultipleKeys(): void + #[Test] + public function prepareDataHierarchyWithMultipleKeys(): void { $source = $this->getMockBuilder(AbstractSource::class) ->setConstructorArgs([$this->adapterMock]) @@ -1615,9 +1676,9 @@ public function testPrepareDataHierarchyWithMultipleKeys(): void $data = $refProp->getValue($source); // Verify nested hierarchy is created - self::assertArrayHasKey('level1', $data); - self::assertArrayHasKey('level2', $data['level1']); - self::assertArrayHasKey('level3', $data['level1']['level2']); + static::assertArrayHasKey('level1', $data); + static::assertArrayHasKey('level2', $data['level1']); + static::assertArrayHasKey('level3', $data['level1']['level2']); } /** @@ -1627,7 +1688,8 @@ public function testPrepareDataHierarchyWithMultipleKeys(): void * @throws ReflectionException * @throws ReflectionException */ - public function testPrepareDataHierarchyWithSingleKey(): void + #[Test] + public function prepareDataHierarchyWithSingleKey(): void { $source = $this->getMockBuilder(AbstractSource::class) ->setConstructorArgs([$this->adapterMock]) @@ -1642,7 +1704,7 @@ public function testPrepareDataHierarchyWithSingleKey(): void $data = $refProp->getValue($source); // Verify single key hierarchy is created - self::assertArrayHasKey('test_key', $data); + static::assertArrayHasKey('test_key', $data); } #[Override] From 7bd6d5aae66f4fcd1d40d66b74cb85ffdd7539c4 Mon Sep 17 00:00:00 2001 From: Simon Mundy Date: Tue, 4 Aug 2026 14:48:45 +1000 Subject: [PATCH 2/2] Remove resolved Metadata test findings from mago lint baseline --- lint-baseline.toml | 1146 -------------------------------------------- 1 file changed, 1146 deletions(-) diff --git a/lint-baseline.toml b/lint-baseline.toml index 436380a8..d62c7073 100644 --- a/lint-baseline.toml +++ b/lint-baseline.toml @@ -2826,1152 +2826,6 @@ code = "prefer-test-attribute" message = "Use `#[Test]` attribute instead of `test` prefix on method `testImplementsContainerExceptionInterface`." count = 1 -[[issues]] -file = "test/unit/Metadata/Object/AbstractTableObjectTest.php" -code = "assertion-style" -message = "Inconsistent assertions style." -count = 15 - -[[issues]] -file = "test/unit/Metadata/Object/AbstractTableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testCompleteTableObjectWithAllProperties`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/AbstractTableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testConstructorWithEmptyString`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/AbstractTableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testConstructorWithName`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/AbstractTableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testConstructorWithNullName`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/AbstractTableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetColumnsReturnsNullWhenNotSet`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/AbstractTableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetConstraintsReturnsNullWhenNotSet`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/AbstractTableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetColumnsAndGetColumns`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/AbstractTableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetColumnsWithEmptyArray`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/AbstractTableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetConstraintsAndGetConstraints`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/AbstractTableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetConstraintsWithEmptyArray`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/AbstractTableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetNameAndGetName`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "assertion-style" -message = "Inconsistent assertions style." -count = 56 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testCompleteColumnObjectWithAllProperties`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testConstructorWithAllParameters`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testConstructorWithNullSchema`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetErrataNonExistentKeyReturnsNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetErratasReturnsEmptyArrayInitially`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testIsNullableAlias`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testIsNumericUnsignedAlias`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetCharacterMaximumLengthAndGetCharacterMaximumLengthWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetCharacterMaximumLengthWithNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetCharacterOctetLengthAndGetCharacterOctetLengthWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetCharacterOctetLengthWithNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetColumnDefaultAndGetColumnDefaultWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetColumnDefaultWithNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetDataTypeAndGetDataTypeWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetErrataAndGetErrata`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetErratasIteratesCorrectly`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetErratasWithArrayAndGetErratas`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetIsNullableAndGetIsNullableWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetNameAndGetName`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetNumericPrecisionAndGetNumericPrecisionWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetNumericScaleAndGetNumericScaleWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetNumericUnsignedAndGetNumericUnsignedWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetOrdinalPositionAndGetOrdinalPositionWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetSchemaNameAndGetSchemaName`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ColumnObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetTableNameAndGetTableNameWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintKeyObjectTest.php" -code = "assertion-style" -message = "Inconsistent assertions style." -count = 40 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintKeyObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testCompleteConstraintKeyObject`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintKeyObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testConstructorSetsColumnName`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintKeyObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testForeignKeyConstants`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintKeyObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetColumnNameAndGetColumnNameWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintKeyObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetForeignKeyDeleteRuleAndGetForeignKeyDeleteRule`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintKeyObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetForeignKeyDeleteRuleWithAllConstants`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintKeyObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetForeignKeyUpdateRuleAndGetForeignKeyUpdateRule`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintKeyObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetForeignKeyUpdateRuleWithAllConstants`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintKeyObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetOrdinalPositionAndGetOrdinalPositionWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintKeyObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetPositionInUniqueConstraintAndGetPositionInUniqueConstraintWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintKeyObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetReferencedColumnNameAndGetReferencedColumnNameWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintKeyObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetReferencedTableNameAndGetReferencedTableNameWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintKeyObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetReferencedTableSchemaAndGetReferencedTableSchemaWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "assertion-style" -message = "Inconsistent assertions style." -count = 79 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testCompleteCheckConstraint`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testCompleteForeignKeyConstraint`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testCompletePrimaryKeyConstraint`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testCompleteUniqueConstraint`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testConstructorWithAllParameters`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testConstructorWithNullSchema`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testHasColumnsReturnsFalseWhenEmpty`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testHasColumnsReturnsTrueWhenPopulated`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testIsCheckReturnsFalseForOtherTypes`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testIsCheckReturnsTrueForCheck`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testIsForeignKeyReturnsFalseForOtherTypes`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testIsForeignKeyReturnsTrueForForeignKey`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testIsPrimaryKeyReturnsFalseForOtherTypes`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testIsPrimaryKeyReturnsTrueForPrimaryKey`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testIsUniqueReturnsFalseForOtherTypes`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testIsUniqueReturnsTrueForUnique`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetCheckClauseAndGetCheckClauseWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetColumnsAndGetColumnsWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetColumnsWithEmptyArray`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetDeleteRuleAndGetDeleteRuleWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetMatchOptionAndGetMatchOptionWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetNameAndGetName`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetReferencedColumnsAndGetReferencedColumnsWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetReferencedTableNameAndGetReferencedTableNameWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetReferencedTableSchemaAndGetReferencedTableSchemaWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetSchemaNameAndGetSchemaName`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetTableNameAndGetTableNameWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetTypeAndGetType`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ConstraintObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetUpdateRuleAndGetUpdateRuleWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TableObjectTest.php" -code = "assertion-style" -message = "Inconsistent assertions style." -count = 14 - -[[issues]] -file = "test/unit/Metadata/Object/TableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testCanBeInstantiated`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testCompleteTableObjectWithAllInheritedFunctionality`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testConstructorWithName`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testConstructorWithNullName`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testExtendsAbstractTableObject`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testInheritedSetColumnsWorks`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testInheritedSetConstraintsWorks`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TableObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testInheritedSetNameWorks`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "assertion-style" -message = "Inconsistent assertions style." -count = 63 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testCompleteTriggerObject`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testNullValuesForAllProperties`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetActionConditionAndGetActionConditionWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetActionOrderAndGetActionOrderWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetActionOrientationAndGetActionOrientationWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetActionReferenceNewRowAndGetActionReferenceNewRowWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetActionReferenceNewTableAndGetActionReferenceNewTableWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetActionReferenceOldRowAndGetActionReferenceOldRowWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetActionReferenceOldTableAndGetActionReferenceOldTableWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetActionStatementAndGetActionStatementWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetActionTimingAndGetActionTimingWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetCreatedAndGetCreatedWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetCreatedWithDifferentDateTime`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetEventManipulationAndGetEventManipulationWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetEventObjectCatalogAndGetEventObjectCatalogWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetEventObjectSchemaAndGetEventObjectSchemaWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetEventObjectTableAndGetEventObjectTableWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/TriggerObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetNameAndGetNameWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "assertion-style" -message = "Inconsistent assertions style." -count = 34 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testCompleteViewObjectWithAllProperties`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testConstructorWithName`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testConstructorWithNullName`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testExtendsAbstractTableObject`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testInheritedColumnsWork`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testInheritedConstraintsWork`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testIsUpdatableAliasWithNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testIsUpdatableAlias`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetCheckOptionAndGetCheckOptionWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetCheckOptionWithNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetIsUpdatableAndGetIsUpdatableWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetIsUpdatableWithFalse`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetIsUpdatableWithNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetViewDefinitionAndGetViewDefinitionWithFluentInterface`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testSetViewDefinitionWithNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testViewObjectWithInheritedSetName`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Object/ViewObjectTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testViewObjectWithNullProperties`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "assertion-style" -message = "Inconsistent assertions style." -count = 132 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testConstructorWithNullSchemaUsesDefaultConstant`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testConstructorWithSchemaFromAdapter`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetColumnNamesThrowsWhenLoadColumnDataDoesNotPopulate`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetColumnNamesUsesDefaultSchemaWhenNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetColumnNames`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetColumnThrowsExceptionForNonExistentColumn`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetColumnUsesDefaultSchemaWhenNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetColumn`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetColumnsUsesDefaultSchemaWhenNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetColumns`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetConstraintKeysUsesDefaultSchemaWhenNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetConstraintKeysWithMultipleKeys`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetConstraintKeysWithoutReferences`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetConstraintKeys`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetConstraintThrowsExceptionForNonExistent`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetConstraintUsesDefaultSchemaWhenNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetConstraintWithCheckClause`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetConstraint`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetConstraintsUsesDefaultSchemaWhenNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetConstraints`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetSchemasCallsLoadSchemaData`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTableForBaseTable`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTableForView`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTableNamesExcludesViewsByDefault`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTableNamesIncludesViewsWhenRequested`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTableNamesWithNullSchemaUsesDefault`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTableNamesWithSpecificSchema`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTableThrowsExceptionForNonExistentTable`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTableThrowsExceptionForUnsupportedTableType`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTableUsesDefaultSchemaWhenNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTablesUsesDefaultSchemaWhenNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTables`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTriggerNamesUsesDefaultSchemaWhenNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTriggerNames`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTriggerThrowsExceptionForNonExistent`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTriggerUsesDefaultSchemaWhenNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTrigger`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTriggersUsesDefaultSchemaWhenNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetTriggers`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetViewForExistingView`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetViewNamesUsesDefaultSchemaWhenNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetViewNames`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetViewThrowsExceptionForNonExistentView`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetViewThrowsExceptionForTable`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetViewUsesDefaultSchemaWhenNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetViewsUsesDefaultSchemaWhenNull`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testGetViews`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testLoadColumnDataCallsPrepareDataHierarchy`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testLoadColumnDataEarlyReturnWhenDataExists`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testLoadConstraintDataCallsPrepareDataHierarchy`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testLoadConstraintDataEarlyReturnWhenDataExists`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testLoadConstraintDataKeysCallsPrepareDataHierarchy`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testLoadConstraintDataKeysEarlyReturnWhenDataExists`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testLoadConstraintReferencesCallsPrepareDataHierarchy`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testLoadConstraintReferencesEarlyReturnWhenDataExists`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testLoadTableNameDataCallsPrepareDataHierarchy`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testLoadTableNameDataEarlyReturnWhenDataExists`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testLoadTriggerDataCallsPrepareDataHierarchy`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testLoadTriggerDataEarlyReturnWhenDataExists`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testPrepareDataHierarchyWithMultipleKeys`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "prefer-test-attribute" -message = "Use `#[Test]` attribute instead of `test` prefix on method `testPrepareDataHierarchyWithSingleKey`." -count = 1 - -[[issues]] -file = "test/unit/Metadata/Source/AbstractSourceTest.php" -code = "strict-assertions" -message = "Use strict assertions in PHPUnit tests." -count = 6 - [[issues]] file = "test/unit/ResultSet/AbstractResultSetIntegrationTest.php" code = "assertion-style"