From 1e2897f8de4482f43fc49522dccd877fdb08bdc4 Mon Sep 17 00:00:00 2001 From: Courtney Miles Date: Sat, 29 Jan 2022 19:07:21 +1000 Subject: [PATCH 1/3] Update package to run for PHP 8 --- .github/workflows/tests.yml | 2 +- Dockerfile | 2 +- composer.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4c1d5fe..3ded6f9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: ['7.2', '7.3', '7.4'] + php-version: ['7.2', '7.3', '7.4', '8.0'] composer-flag: - '--prefer-dist' # - '--prefer-stable --prefer-lowest' diff --git a/Dockerfile b/Dockerfile index ab9237d..d489afc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.4-cli +FROM php:8.0-cli # system dependecies RUN apt-get update && apt-get install -y \ diff --git a/composer.json b/composer.json index d71ec1d..9587231 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php" : "7.2 - 7.4", + "php" : "7.2 - 8.0", "ext-json": "*" }, "require-dev": { From 5e529ba9208a9c0e5c8165976a4ac135035dc7d1 Mon Sep 17 00:00:00 2001 From: Courtney Miles Date: Sat, 29 Jan 2022 19:07:30 +1000 Subject: [PATCH 2/3] Update PHP CS Fixer --- .gitignore | 3 ++- .php_cs.dist => .php-cs-fixer.dist.php | 6 +++--- composer.json | 3 +-- 3 files changed, 6 insertions(+), 6 deletions(-) rename .php_cs.dist => .php-cs-fixer.dist.php (88%) diff --git a/.gitignore b/.gitignore index d207a4a..64c25ee 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ composer.phar composer.lock phpunit.xml Vagrantfile -.php_cs.dist \ No newline at end of file +.php_cs.dist +/.php-cs-fixer.cache diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 88% rename from .php_cs.dist rename to .php-cs-fixer.dist.php index 65fba62..03fdb84 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.dist.php @@ -2,8 +2,8 @@ $finder = PhpCsFixer\Finder::create() ->in(__DIR__); -$config = PhpCsFixer\Config::create() - ->setRules([ +$config = new PhpCsFixer\Config(); +$config->setRules([ '@PSR2' => true, '@Symfony' => true, 'strict_param' => true, @@ -19,4 +19,4 @@ ]) ->setFinder($finder); -return $config; \ No newline at end of file +return $config; diff --git a/composer.json b/composer.json index 9587231..4eafcb5 100644 --- a/composer.json +++ b/composer.json @@ -18,8 +18,7 @@ "require-dev": { "phpunit/phpunit" : "^7.0", "php-coveralls/php-coveralls": "^2.4", - "phpunit/dbunit": "^4.0", - "friendsofphp/php-cs-fixer": "^2.18" + "friendsofphp/php-cs-fixer": "^3.0" }, "autoload": { "psr-4": { From 514bd3129d12828601125ad3b1557c7c583cc67f Mon Sep 17 00:00:00 2001 From: Courtney Miles Date: Sat, 29 Jan 2022 19:08:04 +1000 Subject: [PATCH 3/3] update tests for PHPUnit 9 compatability --- PHPUnit/Framework/IndexTestCase.php | 1 - composer.json | 2 +- .../SchnoopSchema/MySQL/Column/ColumnTest.php | 32 ++++++++++--------- .../Constraint/AbstractConstraintTest.php | 2 +- .../MySQL/Constraint/AbstractIndexTest.php | 2 +- .../MySQL/Constraint/ForeignKeyColumnTest.php | 2 +- .../MySQL/Constraint/ForeignKeyTest.php | 2 +- .../MySQL/Constraint/FullTextIndexTest.php | 2 +- .../MySQL/Constraint/IndexTest.php | 2 +- .../MySQL/Constraint/IndexedColumnTest.php | 2 +- .../MySQL/Constraint/SpatialIndexTest.php | 2 +- .../MySQL/Constraint/UniqueIndexTest.php | 2 +- .../MySQL/DataType/AbstractBinaryTypeTest.php | 2 +- .../MySQL/DataType/AbstractBlobTypeTest.php | 2 +- .../MySQL/DataType/AbstractCharTypeTest.php | 6 ++-- .../MySQL/DataType/AbstractIntTypeTest.php | 6 ++-- .../DataType/AbstractNumericPointTypeTest.php | 6 ++-- .../DataType/AbstractOptionsTypeTest.php | 2 +- .../MySQL/DataType/AbstractTextTypeTest.php | 6 ++-- .../MySQL/DataType/AbstractTimeTypeTest.php | 3 +- .../MySQL/DataType/BigIntTypeTest.php | 2 +- .../MySQL/DataType/BinaryTypeTest.php | 2 +- .../MySQL/DataType/BitTypeTest.php | 2 +- .../MySQL/DataType/BlobTypeTest.php | 2 +- .../MySQL/DataType/CharTypeTest.php | 2 +- .../MySQL/DataType/DateTimeTypeTest.php | 2 +- .../MySQL/DataType/DecimalTypeTest.php | 2 +- .../MySQL/DataType/DoubleTypeTest.php | 2 +- .../MySQL/DataType/EnumTypeTest.php | 2 +- .../MySQL/DataType/FloatTypeTest.php | 2 +- .../MySQL/DataType/IntTypeTest.php | 2 +- .../MySQL/DataType/LongBlobTypeTest.php | 2 +- .../MySQL/DataType/LongTextTypeTest.php | 2 +- .../MySQL/DataType/MediumBlobTypeTest.php | 2 +- .../MySQL/DataType/MediumIntTypeTest.php | 2 +- .../MySQL/DataType/MediumTextTypeTest.php | 2 +- .../MySQL/DataType/Option/QuoteTraitTest.php | 2 +- .../MySQL/DataType/SetTypeTest.php | 2 +- .../MySQL/DataType/SmallIntTypeTest.php | 2 +- .../MySQL/DataType/TextTypeTest.php | 2 +- .../MySQL/DataType/TimeTypeTest.php | 2 +- .../MySQL/DataType/TimestampTypeTest.php | 2 +- .../MySQL/DataType/TinyBlobTypeTest.php | 2 +- .../MySQL/DataType/TinyIntTypeTest.php | 2 +- .../MySQL/DataType/TinyTextTypeTest.php | 2 +- .../MySQL/DataType/VarBinaryTypeTest.php | 2 +- .../MySQL/DataType/VarCharTypeTest.php | 2 +- .../MySQL/Database/DatabaseTest.php | 3 +- .../Routine/AbstractRoutineParameterTest.php | 2 +- .../MySQL/Routine/AbstractRoutineTest.php | 2 +- .../MySQL/Routine/FunctionParameterTest.php | 2 +- .../MySQL/Routine/ProcedureParameterTest.php | 2 +- .../MySQL/Routine/RoutineFunctionTest.php | 11 ++++--- .../MySQL/Routine/RoutineProcedureTest.php | 12 ++++--- .../MySQL/SetVar/SqlModeTest.php | 2 +- tests/SchnoopSchema/MySQL/Table/TableTest.php | 11 ++++--- .../MySQL/Trigger/TriggerTest.php | 12 ++++--- 57 files changed, 102 insertions(+), 97 deletions(-) diff --git a/PHPUnit/Framework/IndexTestCase.php b/PHPUnit/Framework/IndexTestCase.php index 1f18747..c407c87 100644 --- a/PHPUnit/Framework/IndexTestCase.php +++ b/PHPUnit/Framework/IndexTestCase.php @@ -4,7 +4,6 @@ use MilesAsylum\SchnoopSchema\MySQL\Constraint\IndexedColumn; use MilesAsylum\SchnoopSchema\MySQL\Constraint\IndexInterface; -use MilesAsylum\SchnoopSchema\MySQL\Table\TableInterface; abstract class IndexTestCase extends ConstraintTestCase { diff --git a/composer.json b/composer.json index 4eafcb5..74fe40b 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "ext-json": "*" }, "require-dev": { - "phpunit/phpunit" : "^7.0", + "phpunit/phpunit" : ">=7.0", "php-coveralls/php-coveralls": "^2.4", "friendsofphp/php-cs-fixer": "^3.0" }, diff --git a/tests/SchnoopSchema/MySQL/Column/ColumnTest.php b/tests/SchnoopSchema/MySQL/Column/ColumnTest.php index 7a766d7..1ce4e8a 100644 --- a/tests/SchnoopSchema/MySQL/Column/ColumnTest.php +++ b/tests/SchnoopSchema/MySQL/Column/ColumnTest.php @@ -6,11 +6,12 @@ use MilesAsylum\SchnoopSchema\MySQL\DataType\SetType; use MilesAsylum\SchnoopSchema\MySQL\DataType\TimestampType; use MilesAsylum\SchnoopSchema\MySQL\DataType\TimeTypeInterface; +use MilesAsylum\SchnoopSchema\MySQL\Exception\LogicException; use MilesAsylum\SchnoopSchema\PHPUnit\Framework\SchnoopSchemaTestCase; use MilesAsylum\SchnoopSchema\MySQL\Column\Column; use MilesAsylum\SchnoopSchema\MySQL\DataType\DataTypeInterface; use MilesAsylum\SchnoopSchema\MySQL\DataType\NumericTypeInterface; -use PHPUnit_Framework_MockObject_MockObject; +use PHPUnit\Framework\MockObject\MockObject; class ColumnTest extends SchnoopSchemaTestCase { @@ -22,11 +23,11 @@ class ColumnTest extends SchnoopSchemaTestCase protected $name = 'schnoop_col'; /** - * @var DataTypeInterface|PHPUnit_Framework_MockObject_MockObject + * @var DataTypeInterface|MockObject */ protected $dataType; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -149,12 +150,11 @@ public function testNotHasDefaultWhenNotAllowDefaultAndAllowNull() $this->assertNull($this->column->getDefault()); } - /** - * @expectedException \MilesAsylum\SchnoopSchema\MySQL\Exception\LogicException - * @expectedExceptionMessage Unable to set default value for the column. The data-type "FOO" does not support a default. - */ public function testExceptionWhenSetDefaultWhenNotAllowed() { + $this->expectExceptionMessage("Unable to set default value for the column. The data-type \"FOO\" does not support a default."); + $this->expectException(LogicException::class); + /** @var DataTypeInterface|PHPUnit_Framework_MockObject_MockObject $mockDataType */ $mockDataType = $this->createMock(DataTypeInterface::class); $mockDataType->method('cast') @@ -173,12 +173,13 @@ public function testExceptionWhenSetDefaultWhenNotAllowed() $column->setDefault('foo'); } - /** - * @expectedException \MilesAsylum\SchnoopSchema\MySQL\Exception\LogicException - * @expectedExceptionMessage Data type "FOOTYPE" for column "schnoop_col" does not support setting current time on update. - */ public function testExceptionWhenSetOnUpdateCurrentTimestapForUnsupportedDataType() { + $this->expectExceptionMessage( + 'Data type "FOOTYPE" for column "schnoop_col" does not support setting current time on update.' + ); + $this->expectException(LogicException::class); + /** @var DataTypeInterface|PHPUnit_Framework_MockObject_MockObject $mockDataType */ $mockDataType = $this->createMock(DataTypeInterface::class); $mockDataType->method('getType') @@ -236,12 +237,13 @@ public function testSetAutoIncrement() $this->assertTrue($column->isAutoIncrement()); } - /** - * @expectedException \MilesAsylum\SchnoopSchema\MySQL\Exception\LogicException - * @expectedExceptionMessage Unable to set auto-increment property on the column. Data-type "FOO" does not support an auto-incrementing value. - */ public function testExceptionSetAutoIncrementOnUnsupportedType() { + $this->expectExceptionMessage( + 'Unable to set auto-increment property on the column. Data-type "FOO" does not support an auto-incrementing value.' + ); + $this->expectException(LogicException::class); + $this->dataType->method('getType') ->willReturn('FOO'); diff --git a/tests/SchnoopSchema/MySQL/Constraint/AbstractConstraintTest.php b/tests/SchnoopSchema/MySQL/Constraint/AbstractConstraintTest.php index 63b7efa..e05118f 100644 --- a/tests/SchnoopSchema/MySQL/Constraint/AbstractConstraintTest.php +++ b/tests/SchnoopSchema/MySQL/Constraint/AbstractConstraintTest.php @@ -17,7 +17,7 @@ class AbstractConstraintTest extends ConstraintTestCase protected $constraintType = ConstraintInterface::CONSTRAINT_INDEX; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/Constraint/AbstractIndexTest.php b/tests/SchnoopSchema/MySQL/Constraint/AbstractIndexTest.php index 10aafd4..e80b38b 100644 --- a/tests/SchnoopSchema/MySQL/Constraint/AbstractIndexTest.php +++ b/tests/SchnoopSchema/MySQL/Constraint/AbstractIndexTest.php @@ -20,7 +20,7 @@ class AbstractIndexTest extends IndexTestCase protected $indexType = IndexInterface::INDEX_TYPE_BTREE; - public function setUp() + public function setUp(): void { $this->abstractIndex = $this->getMockForAbstractClass( AbstractIndex::class, diff --git a/tests/SchnoopSchema/MySQL/Constraint/ForeignKeyColumnTest.php b/tests/SchnoopSchema/MySQL/Constraint/ForeignKeyColumnTest.php index d6a5b59..3905b3f 100644 --- a/tests/SchnoopSchema/MySQL/Constraint/ForeignKeyColumnTest.php +++ b/tests/SchnoopSchema/MySQL/Constraint/ForeignKeyColumnTest.php @@ -16,7 +16,7 @@ class ForeignKeyColumnTest extends TestCase */ protected $foreignKeyColumn; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/Constraint/ForeignKeyTest.php b/tests/SchnoopSchema/MySQL/Constraint/ForeignKeyTest.php index 678268a..c9ab08b 100644 --- a/tests/SchnoopSchema/MySQL/Constraint/ForeignKeyTest.php +++ b/tests/SchnoopSchema/MySQL/Constraint/ForeignKeyTest.php @@ -16,7 +16,7 @@ class ForeignKeyTest extends ConstraintTestCase */ protected $foreignKey; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/Constraint/FullTextIndexTest.php b/tests/SchnoopSchema/MySQL/Constraint/FullTextIndexTest.php index a9d53a7..92b2801 100644 --- a/tests/SchnoopSchema/MySQL/Constraint/FullTextIndexTest.php +++ b/tests/SchnoopSchema/MySQL/Constraint/FullTextIndexTest.php @@ -12,7 +12,7 @@ class FullTextIndexTest extends IndexTestCase protected $fullTextIndex; - public function setUp() + public function setUp(): void { $this->fullTextIndex = new FullTextIndex($this->constraintName); diff --git a/tests/SchnoopSchema/MySQL/Constraint/IndexTest.php b/tests/SchnoopSchema/MySQL/Constraint/IndexTest.php index 8e41668..2ca233c 100644 --- a/tests/SchnoopSchema/MySQL/Constraint/IndexTest.php +++ b/tests/SchnoopSchema/MySQL/Constraint/IndexTest.php @@ -17,7 +17,7 @@ class IndexTest extends IndexTestCase protected $indexedColumns = []; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/Constraint/IndexedColumnTest.php b/tests/SchnoopSchema/MySQL/Constraint/IndexedColumnTest.php index 7b28910..81663fb 100644 --- a/tests/SchnoopSchema/MySQL/Constraint/IndexedColumnTest.php +++ b/tests/SchnoopSchema/MySQL/Constraint/IndexedColumnTest.php @@ -14,7 +14,7 @@ class IndexedColumnTest extends SchnoopSchemaTestCase */ protected $indexedColumn; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/Constraint/SpatialIndexTest.php b/tests/SchnoopSchema/MySQL/Constraint/SpatialIndexTest.php index 85b83a5..44e204a 100644 --- a/tests/SchnoopSchema/MySQL/Constraint/SpatialIndexTest.php +++ b/tests/SchnoopSchema/MySQL/Constraint/SpatialIndexTest.php @@ -17,7 +17,7 @@ class SpatialIndexTest extends IndexTestCase protected $indexedColumns = []; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/Constraint/UniqueIndexTest.php b/tests/SchnoopSchema/MySQL/Constraint/UniqueIndexTest.php index c715726..e7ed11f 100644 --- a/tests/SchnoopSchema/MySQL/Constraint/UniqueIndexTest.php +++ b/tests/SchnoopSchema/MySQL/Constraint/UniqueIndexTest.php @@ -17,7 +17,7 @@ class UniqueIndexTest extends IndexTestCase protected $indexedColumns = []; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/AbstractBinaryTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/AbstractBinaryTypeTest.php index f0c1cc5..b2bd504 100644 --- a/tests/SchnoopSchema/MySQL/DataType/AbstractBinaryTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/AbstractBinaryTypeTest.php @@ -23,7 +23,7 @@ class AbstractBinaryTypeTest extends BinaryTypeTestCase protected $type = 'foo'; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/AbstractBlobTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/AbstractBlobTypeTest.php index 14284a4..f7beddc 100644 --- a/tests/SchnoopSchema/MySQL/DataType/AbstractBlobTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/AbstractBlobTypeTest.php @@ -16,7 +16,7 @@ class AbstractBlobTypeTest extends DataTypeTestCase protected $type = 'foo'; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/AbstractCharTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/AbstractCharTypeTest.php index 89722d6..40e7a50 100644 --- a/tests/SchnoopSchema/MySQL/DataType/AbstractCharTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/AbstractCharTypeTest.php @@ -4,7 +4,7 @@ use MilesAsylum\SchnoopSchema\MySQL\DataType\AbstractCharType; use MilesAsylum\SchnoopSchema\PHPUnit\Framework\CharTypeTestCase; -use PHPUnit_Framework_MockObject_MockObject; +use PHPUnit\Framework\MockObject\MockObject; class AbstractCharTypeTest extends CharTypeTestCase { @@ -17,7 +17,7 @@ class AbstractCharTypeTest extends CharTypeTestCase protected $length = 6; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -47,7 +47,7 @@ public function testInitialProperties() /** * @param $type - * @return AbstractCharType|PHPUnit_Framework_MockObject_MockObject + * @return AbstractCharType|MockObject */ protected function createMockAbstractCharType($type) { diff --git a/tests/SchnoopSchema/MySQL/DataType/AbstractIntTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/AbstractIntTypeTest.php index 68a7fd0..e2ba5ba 100644 --- a/tests/SchnoopSchema/MySQL/DataType/AbstractIntTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/AbstractIntTypeTest.php @@ -4,7 +4,7 @@ use MilesAsylum\SchnoopSchema\PHPUnit\Framework\IntTypeTestCase; use MilesAsylum\SchnoopSchema\MySQL\DataType\AbstractIntType; -use PHPUnit_Framework_MockObject_MockObject; +use PHPUnit\Framework\MockObject\MockObject; class AbstractIntTypeTest extends IntTypeTestCase { @@ -15,7 +15,7 @@ class AbstractIntTypeTest extends IntTypeTestCase protected $type = 'foo'; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -60,7 +60,7 @@ public function DDLProvider() /** * @param string $type - * @return AbstractIntType|PHPUnit_Framework_MockObject_MockObject + * @return AbstractIntType|MockObject */ protected function createMockAbstractIntType($type) { diff --git a/tests/SchnoopSchema/MySQL/DataType/AbstractNumericPointTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/AbstractNumericPointTypeTest.php index 837042e..528f960 100644 --- a/tests/SchnoopSchema/MySQL/DataType/AbstractNumericPointTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/AbstractNumericPointTypeTest.php @@ -4,7 +4,7 @@ use MilesAsylum\SchnoopSchema\PHPUnit\Framework\NumericPointTypeTestCase; use MilesAsylum\SchnoopSchema\MySQL\DataType\AbstractNumericPointType; -use PHPUnit_Framework_MockObject_MockObject; +use PHPUnit\Framework\MockObject\MockObject; class AbstractNumericPointTypeTest extends NumericPointTypeTestCase { @@ -15,7 +15,7 @@ class AbstractNumericPointTypeTest extends NumericPointTypeTestCase protected $type = 'foo'; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -40,7 +40,7 @@ public function testInitialProperties() /** * @param $type - * @return AbstractNumericPointType|PHPUnit_Framework_MockObject_MockObject + * @return AbstractNumericPointType|MockObject */ protected function createMockAbstractNumericPointType($type) { diff --git a/tests/SchnoopSchema/MySQL/DataType/AbstractOptionsTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/AbstractOptionsTypeTest.php index 4acc508..ce38028 100644 --- a/tests/SchnoopSchema/MySQL/DataType/AbstractOptionsTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/AbstractOptionsTypeTest.php @@ -14,7 +14,7 @@ class AbstractOptionsTypeTest extends OptionsTypeTestCase protected $type = 'foo'; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/AbstractTextTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/AbstractTextTypeTest.php index 164baf5..d29e7c0 100644 --- a/tests/SchnoopSchema/MySQL/DataType/AbstractTextTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/AbstractTextTypeTest.php @@ -5,7 +5,7 @@ use MilesAsylum\SchnoopSchema\MySQL\DataType\AbstractBlobType; use MilesAsylum\SchnoopSchema\MySQL\DataType\AbstractTextType; use MilesAsylum\SchnoopSchema\PHPUnit\Framework\TextTypeTestCase; -use PHPUnit_Framework_MockObject_MockObject; +use PHPUnit\Framework\MockObject\MockObject; class AbstractTextTypeTest extends TextTypeTestCase { @@ -16,7 +16,7 @@ class AbstractTextTypeTest extends TextTypeTestCase protected $type = 'foo'; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -41,7 +41,7 @@ public function testInitialProperties() /** * @param string $type - * @return AbstractTextType|PHPUnit_Framework_MockObject_MockObject + * @return AbstractTextType|MockObject */ protected function createMockAbstractTextType($type) { diff --git a/tests/SchnoopSchema/MySQL/DataType/AbstractTimeTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/AbstractTimeTypeTest.php index 15700aa..17b0bad 100644 --- a/tests/SchnoopSchema/MySQL/DataType/AbstractTimeTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/AbstractTimeTypeTest.php @@ -4,7 +4,6 @@ use MilesAsylum\SchnoopSchema\MySQL\DataType\AbstractTimeType; use MilesAsylum\SchnoopSchema\PHPUnit\Framework\TimeTypeTestCase; -use PHPUnit_Framework_MockObject_MockObject; class AbstractTimeTypeTest extends TimeTypeTestCase { @@ -12,7 +11,7 @@ class AbstractTimeTypeTest extends TimeTypeTestCase protected $type = 'foo'; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/BigIntTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/BigIntTypeTest.php index 2e6e22e..f5534cf 100644 --- a/tests/SchnoopSchema/MySQL/DataType/BigIntTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/BigIntTypeTest.php @@ -13,7 +13,7 @@ class BigIntTypeTest extends IntTypeTestCase */ protected $bigIntType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/BinaryTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/BinaryTypeTest.php index 04c96b6..b0403d9 100644 --- a/tests/SchnoopSchema/MySQL/DataType/BinaryTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/BinaryTypeTest.php @@ -13,7 +13,7 @@ class BinaryTypeTest extends BinaryTypeTestCase */ protected $binaryType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/BitTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/BitTypeTest.php index 3e06575..7253007 100644 --- a/tests/SchnoopSchema/MySQL/DataType/BitTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/BitTypeTest.php @@ -19,7 +19,7 @@ class BitTypeTest extends SchnoopSchemaTestCase */ protected $bitType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/BlobTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/BlobTypeTest.php index 2b5cf90..16f77f9 100644 --- a/tests/SchnoopSchema/MySQL/DataType/BlobTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/BlobTypeTest.php @@ -13,7 +13,7 @@ class BlobTypeTest extends DataTypeTestCase */ protected $blobType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/CharTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/CharTypeTest.php index 252d903..23059e2 100644 --- a/tests/SchnoopSchema/MySQL/DataType/CharTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/CharTypeTest.php @@ -14,7 +14,7 @@ class CharTypeTest extends CharTypeTestCase protected $charType; protected $length = 1; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/DateTimeTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/DateTimeTypeTest.php index 2143d59..1144947 100644 --- a/tests/SchnoopSchema/MySQL/DataType/DateTimeTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/DateTimeTypeTest.php @@ -13,7 +13,7 @@ class DateTimeTypeTest extends TimeTypeTestCase */ protected $dateTimeType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/DecimalTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/DecimalTypeTest.php index bde37f2..0cd11c3 100644 --- a/tests/SchnoopSchema/MySQL/DataType/DecimalTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/DecimalTypeTest.php @@ -12,7 +12,7 @@ class DecimalTypeTest extends NumericPointTypeTestCase */ protected $decimalType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/DoubleTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/DoubleTypeTest.php index 1e7d500..ab56f10 100644 --- a/tests/SchnoopSchema/MySQL/DataType/DoubleTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/DoubleTypeTest.php @@ -12,7 +12,7 @@ class DoubleTypeTest extends NumericPointTypeTestCase */ protected $doubleType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/EnumTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/EnumTypeTest.php index 8360f36..cf086b9 100644 --- a/tests/SchnoopSchema/MySQL/DataType/EnumTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/EnumTypeTest.php @@ -13,7 +13,7 @@ class EnumTypeTest extends OptionsTypeTestCase */ protected $enumType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/FloatTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/FloatTypeTest.php index f5863ff..0ce1f35 100644 --- a/tests/SchnoopSchema/MySQL/DataType/FloatTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/FloatTypeTest.php @@ -13,7 +13,7 @@ class FloatTypeTest extends NumericPointTypeTestCase */ protected $floatType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/IntTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/IntTypeTest.php index ac1573b..d101544 100644 --- a/tests/SchnoopSchema/MySQL/DataType/IntTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/IntTypeTest.php @@ -13,7 +13,7 @@ class IntTypeTest extends IntTypeTestCase */ protected $intType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/LongBlobTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/LongBlobTypeTest.php index 965dce6..60635d3 100644 --- a/tests/SchnoopSchema/MySQL/DataType/LongBlobTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/LongBlobTypeTest.php @@ -13,7 +13,7 @@ class LongBlobTypeTest extends DataTypeTestCase */ protected $longBlobType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/LongTextTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/LongTextTypeTest.php index 1acff5a..43aa77a 100644 --- a/tests/SchnoopSchema/MySQL/DataType/LongTextTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/LongTextTypeTest.php @@ -14,7 +14,7 @@ class LongTextTypeTest extends TextTypeTestCase */ protected $longTextType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/MediumBlobTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/MediumBlobTypeTest.php index 7f9c9a2..9728415 100644 --- a/tests/SchnoopSchema/MySQL/DataType/MediumBlobTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/MediumBlobTypeTest.php @@ -13,7 +13,7 @@ class MediumBlobTypeTest extends DataTypeTestCase */ protected $mediumBlobType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/MediumIntTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/MediumIntTypeTest.php index e14401e..e5eba5b 100644 --- a/tests/SchnoopSchema/MySQL/DataType/MediumIntTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/MediumIntTypeTest.php @@ -13,7 +13,7 @@ class MediumIntTypeTest extends IntTypeTestCase */ protected $mediumIntType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/MediumTextTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/MediumTextTypeTest.php index 4443e62..57c80cc 100644 --- a/tests/SchnoopSchema/MySQL/DataType/MediumTextTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/MediumTextTypeTest.php @@ -14,7 +14,7 @@ class MediumTextTypeTest extends TextTypeTestCase */ protected $mediumTextType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/Option/QuoteTraitTest.php b/tests/SchnoopSchema/MySQL/DataType/Option/QuoteTraitTest.php index 5dbf8bc..496fadc 100644 --- a/tests/SchnoopSchema/MySQL/DataType/Option/QuoteTraitTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/Option/QuoteTraitTest.php @@ -12,7 +12,7 @@ class QuoteTraitTest extends TestCase */ protected $quoteTrait; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/SetTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/SetTypeTest.php index d8ddb4d..e7d360c 100644 --- a/tests/SchnoopSchema/MySQL/DataType/SetTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/SetTypeTest.php @@ -13,7 +13,7 @@ class SetTypeTest extends OptionsTypeTestCase */ protected $setType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/SmallIntTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/SmallIntTypeTest.php index 2399b66..60a9733 100644 --- a/tests/SchnoopSchema/MySQL/DataType/SmallIntTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/SmallIntTypeTest.php @@ -13,7 +13,7 @@ class SmallIntTypeTest extends IntTypeTestCase */ protected $smallIntType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/TextTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/TextTypeTest.php index b892e77..a331c1b 100644 --- a/tests/SchnoopSchema/MySQL/DataType/TextTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/TextTypeTest.php @@ -14,7 +14,7 @@ class TextTypeTest extends TextTypeTestCase */ protected $textType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/TimeTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/TimeTypeTest.php index 61fd2b9..bc0b932 100644 --- a/tests/SchnoopSchema/MySQL/DataType/TimeTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/TimeTypeTest.php @@ -13,7 +13,7 @@ class TimeTypeTest extends TimeTypeTestCase */ protected $timeType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/TimestampTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/TimestampTypeTest.php index 18a9456..b57ab01 100644 --- a/tests/SchnoopSchema/MySQL/DataType/TimestampTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/TimestampTypeTest.php @@ -13,7 +13,7 @@ class TimestampTypeTest extends TimeTypeTestCase */ protected $timestampType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/TinyBlobTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/TinyBlobTypeTest.php index 72c4ec6..ee0a8e5 100644 --- a/tests/SchnoopSchema/MySQL/DataType/TinyBlobTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/TinyBlobTypeTest.php @@ -19,7 +19,7 @@ class TinyBlobTypeTest extends DataTypeTestCase */ protected $tinyBlobType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/TinyIntTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/TinyIntTypeTest.php index c4493dd..6e71968 100644 --- a/tests/SchnoopSchema/MySQL/DataType/TinyIntTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/TinyIntTypeTest.php @@ -13,7 +13,7 @@ class TinyIntTypeTest extends IntTypeTestCase */ protected $tinyIntType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/TinyTextTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/TinyTextTypeTest.php index 32778d5..e130575 100644 --- a/tests/SchnoopSchema/MySQL/DataType/TinyTextTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/TinyTextTypeTest.php @@ -14,7 +14,7 @@ class TinyTextTypeTest extends TextTypeTestCase */ protected $tinyTextType; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/VarBinaryTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/VarBinaryTypeTest.php index 6927d14..d1c0e83 100644 --- a/tests/SchnoopSchema/MySQL/DataType/VarBinaryTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/VarBinaryTypeTest.php @@ -15,7 +15,7 @@ class VarBinaryTypeTest extends BinaryTypeTestCase protected $length = 5; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/DataType/VarCharTypeTest.php b/tests/SchnoopSchema/MySQL/DataType/VarCharTypeTest.php index 35951a1..8ca35da 100644 --- a/tests/SchnoopSchema/MySQL/DataType/VarCharTypeTest.php +++ b/tests/SchnoopSchema/MySQL/DataType/VarCharTypeTest.php @@ -14,7 +14,7 @@ class VarCharTypeTest extends CharTypeTestCase protected $varCharType; protected $length = 6; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/Database/DatabaseTest.php b/tests/SchnoopSchema/MySQL/Database/DatabaseTest.php index f1c6d6f..1328eea 100644 --- a/tests/SchnoopSchema/MySQL/Database/DatabaseTest.php +++ b/tests/SchnoopSchema/MySQL/Database/DatabaseTest.php @@ -4,7 +4,6 @@ use MilesAsylum\SchnoopSchema\MySQL\DroppableInterface; use MilesAsylum\SchnoopSchema\MySQL\HasDelimiterInterface; -use MilesAsylum\SchnoopSchema\MySQL\MySQLInterface; use MilesAsylum\SchnoopSchema\PHPUnit\Framework\SchnoopSchemaTestCase; use MilesAsylum\SchnoopSchema\MySQL\Database\Database; @@ -24,7 +23,7 @@ class DatabaseTest extends SchnoopSchemaTestCase 'schnoop_table_two' ]; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/Routine/AbstractRoutineParameterTest.php b/tests/SchnoopSchema/MySQL/Routine/AbstractRoutineParameterTest.php index ca4dcee..df5d11d 100644 --- a/tests/SchnoopSchema/MySQL/Routine/AbstractRoutineParameterTest.php +++ b/tests/SchnoopSchema/MySQL/Routine/AbstractRoutineParameterTest.php @@ -20,7 +20,7 @@ class AbstractRoutineParameterTest extends RoutineParameterTestCase */ protected $abstractRoutineParameter; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/Routine/AbstractRoutineTest.php b/tests/SchnoopSchema/MySQL/Routine/AbstractRoutineTest.php index 0295fae..4b0d7ff 100644 --- a/tests/SchnoopSchema/MySQL/Routine/AbstractRoutineTest.php +++ b/tests/SchnoopSchema/MySQL/Routine/AbstractRoutineTest.php @@ -13,7 +13,7 @@ class AbstractRoutineTest extends RoutineTestCase */ protected $routine; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/Routine/FunctionParameterTest.php b/tests/SchnoopSchema/MySQL/Routine/FunctionParameterTest.php index 1caa523..54a4b80 100644 --- a/tests/SchnoopSchema/MySQL/Routine/FunctionParameterTest.php +++ b/tests/SchnoopSchema/MySQL/Routine/FunctionParameterTest.php @@ -21,7 +21,7 @@ class FunctionParameterTest extends RoutineParameterTestCase */ protected $functionParameter; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/Routine/ProcedureParameterTest.php b/tests/SchnoopSchema/MySQL/Routine/ProcedureParameterTest.php index 1964815..2b3969c 100644 --- a/tests/SchnoopSchema/MySQL/Routine/ProcedureParameterTest.php +++ b/tests/SchnoopSchema/MySQL/Routine/ProcedureParameterTest.php @@ -22,7 +22,7 @@ class ProcedureParameterTest extends RoutineParameterTestCase */ protected $procedureParameter; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/Routine/RoutineFunctionTest.php b/tests/SchnoopSchema/MySQL/Routine/RoutineFunctionTest.php index c84243a..dc5e6d2 100644 --- a/tests/SchnoopSchema/MySQL/Routine/RoutineFunctionTest.php +++ b/tests/SchnoopSchema/MySQL/Routine/RoutineFunctionTest.php @@ -4,6 +4,7 @@ use MilesAsylum\SchnoopSchema\MySQL\DataType\DataTypeInterface; use MilesAsylum\SchnoopSchema\MySQL\DroppableInterface; +use MilesAsylum\SchnoopSchema\MySQL\Exception\FQNException; use MilesAsylum\SchnoopSchema\MySQL\HasDelimiterInterface; use MilesAsylum\SchnoopSchema\MySQL\MySQLInterface; use MilesAsylum\SchnoopSchema\MySQL\Routine\FunctionParameterInterface; @@ -28,7 +29,7 @@ class RoutineFunctionTest extends RoutineTestCase */ protected $function; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -246,12 +247,12 @@ public function getDDLTestData() ]; } - /** - * @expectedException \MilesAsylum\SchnoopSchema\MySQL\Exception\FQNException - * @expectedExceptionMessage Unable to create DDL with fully-qualified-name because the database name has not been set. - */ public function testExceptionOnUseFQNWhenDatabaseNameNotSet() { + $this->expectExceptionMessage( + 'Unable to create DDL with fully-qualified-name because the database name has not been set.' + ); + $this->expectException(FQNException::class); $routine = $this->getRoutine(); $routine->setUseFullyQualifiedName(true); diff --git a/tests/SchnoopSchema/MySQL/Routine/RoutineProcedureTest.php b/tests/SchnoopSchema/MySQL/Routine/RoutineProcedureTest.php index afe6ba7..e010ee4 100644 --- a/tests/SchnoopSchema/MySQL/Routine/RoutineProcedureTest.php +++ b/tests/SchnoopSchema/MySQL/Routine/RoutineProcedureTest.php @@ -3,6 +3,7 @@ namespace MilesAsylum\SchnoopSchema\Tests\SchnoopSchema\MySQL\Routine; use MilesAsylum\SchnoopSchema\MySQL\DroppableInterface; +use MilesAsylum\SchnoopSchema\MySQL\Exception\FQNException; use MilesAsylum\SchnoopSchema\MySQL\HasDelimiterInterface; use MilesAsylum\SchnoopSchema\MySQL\MySQLInterface; use MilesAsylum\SchnoopSchema\MySQL\Routine\ProcedureParameterInterface; @@ -21,7 +22,7 @@ class RoutineProcedureTest extends RoutineTestCase */ protected $procedure; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -208,12 +209,13 @@ public function getDDLTestData() ]; } - /** - * @expectedException \MilesAsylum\SchnoopSchema\MySQL\Exception\FQNException - * @expectedExceptionMessage Unable to create DDL with fully-qualified-name because the database name has not been set. - */ public function testExceptionOnUseFQNWhenDatabaseNameNotSet() { + $this->expectExceptionMessage( + 'Unable to create DDL with fully-qualified-name because the database name has not been set.' + ); + $this->expectException(FQNException::class); + $routine = $this->getRoutine(); $routine->setUseFullyQualifiedName(true); diff --git a/tests/SchnoopSchema/MySQL/SetVar/SqlModeTest.php b/tests/SchnoopSchema/MySQL/SetVar/SqlModeTest.php index 7a66ee2..1a3a953 100644 --- a/tests/SchnoopSchema/MySQL/SetVar/SqlModeTest.php +++ b/tests/SchnoopSchema/MySQL/SetVar/SqlModeTest.php @@ -15,7 +15,7 @@ class SqlModeTest extends TestCase protected $sqlMode; protected $mode = 'FOO'; - public function setUp() + public function setUp(): void { parent::setUp(); diff --git a/tests/SchnoopSchema/MySQL/Table/TableTest.php b/tests/SchnoopSchema/MySQL/Table/TableTest.php index 55d0dd0..03eb85c 100644 --- a/tests/SchnoopSchema/MySQL/Table/TableTest.php +++ b/tests/SchnoopSchema/MySQL/Table/TableTest.php @@ -21,7 +21,7 @@ class TableTest extends SchnoopSchemaTestCase protected $name = 'schnoop_tbl'; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -332,12 +332,13 @@ public function testToStringAliasesGetDDL() $this->assertSame($ddl, (string)$mockTable); } - /** - * @expectedException \MilesAsylum\SchnoopSchema\MySQL\Exception\FQNException - * @expectedExceptionMessage Unable to create DDL with fully-qualified-name because the database name has not been set. - */ public function testExceptionOnUseFQNWhenDatabaseNameNotSet() { + $this->expectExceptionMessage( + 'Unable to create DDL with fully-qualified-name because the database name has not been set.' + ); + $this->expectException(\MilesAsylum\SchnoopSchema\MySQL\Exception\FQNException::class); + $this->table->setUseFullyQualifiedName(true); $this->table->getCreateStatement(); diff --git a/tests/SchnoopSchema/MySQL/Trigger/TriggerTest.php b/tests/SchnoopSchema/MySQL/Trigger/TriggerTest.php index 713b594..0331d95 100644 --- a/tests/SchnoopSchema/MySQL/Trigger/TriggerTest.php +++ b/tests/SchnoopSchema/MySQL/Trigger/TriggerTest.php @@ -3,6 +3,7 @@ namespace MilesAsylum\SchnoopSchema\Tests\SchnoopSchema\MySQL\Trigger; use MilesAsylum\SchnoopSchema\MySQL\DroppableInterface; +use MilesAsylum\SchnoopSchema\MySQL\Exception\FQNException; use MilesAsylum\SchnoopSchema\MySQL\HasDelimiterInterface; use MilesAsylum\SchnoopSchema\MySQL\SetVar\SqlMode; use MilesAsylum\SchnoopSchema\MySQL\Trigger\Trigger; @@ -24,7 +25,7 @@ class TriggerTest extends TestCase protected $tableName = 'schnoop_tbl'; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -193,12 +194,13 @@ public function testToStringAliasesGetDDL() $this->assertSame($ddl, (string)$mockTrigger); } - /** - * @expectedException \MilesAsylum\SchnoopSchema\MySQL\Exception\FQNException - * @expectedExceptionMessage Unable to create DDL with fully-qualified-name because the database name has not been set. - */ public function testExceptionOnUseFQNWhenDatabaseNameNotSet() { + $this->expectExceptionMessage( + 'Unable to create DDL with fully-qualified-name because the database name has not been set.' + ); + $this->expectException(FQNException::class); + $this->trigger->setUseFullyQualifiedName(true); $this->trigger->getCreateStatement();