From 595284ff2e8b10ace04a958406a0aec8b27e299e Mon Sep 17 00:00:00 2001 From: ZVanoZ Date: Fri, 24 Sep 2021 19:26:16 +0300 Subject: [PATCH] MySQL and MSQL fixtures now recreate test structure. --- composer.lock | 133 +++++------------- test/integration/TestFixtures/mysql.sql | 9 +- .../TestFixtures/sqlsrv-triggers.sql | 2 +- .../integration/TestFixtures/sqlsrv-views.sql | 2 +- test/integration/TestFixtures/sqlsrv.sql | 6 +- 5 files changed, 48 insertions(+), 104 deletions(-) diff --git a/composer.lock b/composer.lock index 665a57172..6f4640f00 100644 --- a/composer.lock +++ b/composer.lock @@ -440,46 +440,43 @@ }, { "name": "laminas/laminas-servicemanager", - "version": "3.7.0", + "version": "3.10.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-servicemanager.git", - "reference": "2b0aee477fdbd3191af7c302b93dbc5fda0626f4" + "reference": "e52b985909e0940bf22d34f322eb3f48bbef6bd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/2b0aee477fdbd3191af7c302b93dbc5fda0626f4", - "reference": "2b0aee477fdbd3191af7c302b93dbc5fda0626f4", + "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/e52b985909e0940bf22d34f322eb3f48bbef6bd1", + "reference": "e52b985909e0940bf22d34f322eb3f48bbef6bd1", "shasum": "" }, "require": { "container-interop/container-interop": "^1.2", "laminas/laminas-stdlib": "^3.2.1", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.3 || ~8.0.0", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0", "psr/container": "^1.0" }, "conflict": { "laminas/laminas-code": "<3.3.1", - "zendframework/zend-code": "<3.3.1" + "zendframework/zend-code": "<3.3.1", + "zendframework/zend-servicemanager": "*" }, "provide": { "container-interop/container-interop-implementation": "^1.2", "psr/container-implementation": "^1.0" }, - "replace": { - "zendframework/zend-servicemanager": "^3.4.0" - }, "require-dev": { "composer/package-versions-deprecated": "^1.0", - "laminas/laminas-coding-standard": "~2.2.0", + "laminas/laminas-coding-standard": "~2.2.1", "laminas/laminas-container-config-test": "^0.3", "laminas/laminas-dependency-plugin": "^2.1.2", - "mikey179/vfsstream": "^1.6.8", - "ocramius/proxy-manager": "^2.2.3", - "phpbench/phpbench": "^1.0.4", + "mikey179/vfsstream": "^1.6.10@alpha", + "ocramius/proxy-manager": "^2.11", + "phpbench/phpbench": "^1.1", "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.4", + "phpunit/phpunit": "^9.5.5", "psalm/plugin-phpunit": "^0.16.1", "vimeo/psalm": "^4.8" }, @@ -525,69 +522,7 @@ "type": "community_bridge" } ], - "time": "2021-07-24T19:33:07+00:00" - }, - { - "name": "laminas/laminas-zendframework-bridge", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-zendframework-bridge.git", - "reference": "bf180a382393e7db5c1e8d0f2ec0c4af9c724baf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/bf180a382393e7db5c1e8d0f2ec0c4af9c724baf", - "reference": "bf180a382393e7db5c1e8d0f2ec0c4af9c724baf", - "shasum": "" - }, - "require": { - "php": "^7.3 || ~8.0.0 || ~8.1.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "psalm/plugin-phpunit": "^0.15.1", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.6" - }, - "type": "library", - "extra": { - "laminas": { - "module": "Laminas\\ZendFrameworkBridge" - } - }, - "autoload": { - "files": [ - "src/autoload.php" - ], - "psr-4": { - "Laminas\\ZendFrameworkBridge\\": "src//" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Alias legacy ZF class names to Laminas Project equivalents.", - "keywords": [ - "ZendFramework", - "autoloading", - "laminas", - "zf" - ], - "support": { - "forum": "https://discourse.laminas.dev/", - "issues": "https://github.com/laminas/laminas-zendframework-bridge/issues", - "rss": "https://github.com/laminas/laminas-zendframework-bridge/releases.atom", - "source": "https://github.com/laminas/laminas-zendframework-bridge" - }, - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2021-09-03T17:53:30+00:00" + "time": "2021-09-18T20:19:36+00:00" }, { "name": "myclabs/deep-copy", @@ -649,16 +584,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.12.0", + "version": "v4.13.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "6608f01670c3cc5079e18c1dab1104e002579143" + "reference": "50953a2691a922aa1769461637869a0a2faa3f53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6608f01670c3cc5079e18c1dab1104e002579143", - "reference": "6608f01670c3cc5079e18c1dab1104e002579143", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53", + "reference": "50953a2691a922aa1769461637869a0a2faa3f53", "shasum": "" }, "require": { @@ -699,9 +634,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.12.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0" }, - "time": "2021-07-21T10:44:31+00:00" + "time": "2021-09-20T12:20:58+00:00" }, { "name": "phar-io/manifest", @@ -925,16 +860,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.4.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" + "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/30f38bffc6f24293dadd1823936372dfa9e86e2f", + "reference": "30f38bffc6f24293dadd1823936372dfa9e86e2f", "shasum": "" }, "require": { @@ -942,7 +877,8 @@ "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "*" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -968,9 +904,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.0" }, - "time": "2020-09-17T18:55:26+00:00" + "time": "2021-09-17T15:28:14+00:00" }, { "name": "phpspec/prophecy", @@ -1094,23 +1030,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.6", + "version": "9.2.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f6293e1b30a2354e8428e004689671b83871edde" + "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f6293e1b30a2354e8428e004689671b83871edde", - "reference": "f6293e1b30a2354e8428e004689671b83871edde", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218", + "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.10.2", + "nikic/php-parser": "^4.12.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -1159,7 +1095,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7" }, "funding": [ { @@ -1167,7 +1103,7 @@ "type": "github" } ], - "time": "2021-03-28T07:26:59+00:00" + "time": "2021-09-17T05:39:03+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2414,7 +2350,6 @@ "type": "github" } ], - "abandoned": true, "time": "2020-09-28T06:45:17+00:00" }, { diff --git a/test/integration/TestFixtures/mysql.sql b/test/integration/TestFixtures/mysql.sql index cfcbbdb30..d1a49b03a 100644 --- a/test/integration/TestFixtures/mysql.sql +++ b/test/integration/TestFixtures/mysql.sql @@ -1,4 +1,5 @@ -CREATE TABLE IF NOT EXISTS test ( +DROP TABLE IF EXISTS test; +CREATE TABLE test ( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL, value VARCHAR(255) NOT NULL, @@ -11,7 +12,8 @@ INSERT INTO test (name, value) VALUES ('123a', 'bar'), ('123', 'bar'); -CREATE TABLE IF NOT EXISTS test_charset ( +DROP TABLE IF EXISTS test_charset; +CREATE TABLE test_charset ( id INT NOT NULL AUTO_INCREMENT, field$ VARCHAR(255) NOT NULL, field_ VARCHAR(255) NOT NULL, @@ -22,6 +24,7 @@ INSERT INTO test_charset (field$, field_) VALUES ('foo', 'bar'), ('bar', 'baz'); +DROP TABLE IF EXISTS test_audit_trail; CREATE TABLE test_audit_trail ( id INT NOT NULL AUTO_INCREMENT, test_id INT NOT NULL, @@ -31,6 +34,7 @@ CREATE TABLE test_audit_trail ( PRIMARY KEY (id) ); +DROP VIEW IF EXISTS test_view; CREATE VIEW test_view AS SELECT @@ -39,6 +43,7 @@ SELECT FROM test; +DROP TRIGGER IF EXISTS after_test_update; CREATE TRIGGER after_test_update AFTER UPDATE ON test FOR EACH ROW diff --git a/test/integration/TestFixtures/sqlsrv-triggers.sql b/test/integration/TestFixtures/sqlsrv-triggers.sql index f39bc73a7..bb4bf3a9a 100644 --- a/test/integration/TestFixtures/sqlsrv-triggers.sql +++ b/test/integration/TestFixtures/sqlsrv-triggers.sql @@ -1,4 +1,4 @@ -CREATE TRIGGER after_test_update ON test +CREATE OR ALTER TRIGGER after_test_update ON test AFTER UPDATE AS BEGIN diff --git a/test/integration/TestFixtures/sqlsrv-views.sql b/test/integration/TestFixtures/sqlsrv-views.sql index 143a75de4..0a9992e35 100644 --- a/test/integration/TestFixtures/sqlsrv-views.sql +++ b/test/integration/TestFixtures/sqlsrv-views.sql @@ -1,4 +1,4 @@ -CREATE VIEW test_view +CREATE OR ALTER VIEW test_view AS ( SELECT name AS v_name, diff --git a/test/integration/TestFixtures/sqlsrv.sql b/test/integration/TestFixtures/sqlsrv.sql index 1811428f1..eae80331b 100644 --- a/test/integration/TestFixtures/sqlsrv.sql +++ b/test/integration/TestFixtures/sqlsrv.sql @@ -1,3 +1,4 @@ +DROP TABLE IF EXISTS test; CREATE TABLE test ( id INT NOT NULL IDENTITY, name VARCHAR(255) NOT NULL, @@ -11,6 +12,7 @@ INSERT INTO test (name, value) VALUES ('123a', 'bar'), ('123', 'bar'); +DROP TABLE IF EXISTS test_charset; CREATE TABLE test_charset ( id INT NOT NULL IDENTITY, field$ VARCHAR(255) NOT NULL, @@ -22,6 +24,7 @@ INSERT INTO test_charset (field$, field_) VALUES ('foo', 'bar'), ('bar', 'baz'); +DROP TABLE IF EXISTS test_audit_trail CREATE TABLE test_audit_trail ( id INT NOT NULL IDENTITY, test_id INT NOT NULL, @@ -29,4 +32,5 @@ CREATE TABLE test_audit_trail ( test_value_new VARCHAR(255) NOT NULL, changed DATETIME2(0), PRIMARY KEY (id) -); \ No newline at end of file +); +