From 8065c2152adce7bba1e663c942b24d534db53d12 Mon Sep 17 00:00:00 2001 From: Tom H Anderson Date: Mon, 20 Jul 2020 16:44:54 -0600 Subject: [PATCH] Converted to Laminas --- Module.php | 22 ---------------------- config/module.config.php | 14 ++++++-------- phpunit.xml | 2 +- src/CollectionExtract.php | 2 +- src/CollectionLink.php | 2 +- src/CollectionLinkFactory.php | 2 +- src/EntityLink.php | 2 +- src/EntityLinkFactory.php | 2 +- src/Module.php | 11 +++++++++++ test/ApiSkeletonsTest/StrategyTest.php | 3 +-- test/Bootstrap.php | 2 +- test/TestConfig.php | 2 ++ test/autoload/local.php | 8 ++++++++ test/module/DbApi/config/module.config.php | 8 ++++---- test/module/DbApi/src/DbApi/Module.php | 1 + 15 files changed, 40 insertions(+), 43 deletions(-) delete mode 100644 Module.php create mode 100644 src/Module.php diff --git a/Module.php b/Module.php deleted file mode 100644 index 02cc798..0000000 --- a/Module.php +++ /dev/null @@ -1,22 +0,0 @@ - array( - 'namespaces' => array( - __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, - ), - ), - ); - } -} diff --git a/config/module.config.php b/config/module.config.php index 3bfc152..aaad32e 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -2,15 +2,13 @@ return array( 'service_manager' => array( - 'invokables' => array( - 'ZF\Doctrine\Hydrator\Strategy\CollectionExtract' => - 'ZF\Doctrine\Hydrator\Strategy\CollectionExtract', - ), 'factories' => array( - 'ZF\Doctrine\Hydrator\Strategy\CollectionLink' => - 'ZF\Doctrine\Hydrator\Strategy\CollectionLinkFactory', - 'ZF\Doctrine\Hydrator\Strategy\EntityLink' => - 'ZF\Doctrine\Hydrator\Strategy\EntityLinkFactory', + 'ApiSkeletons\Doctrine\Hydrator\Strategy\CollectionExtract' => + 'Laminas\ServiceManager\Factory\InvokableFactory', + 'ApiSkeletons\Doctrine\Hydrator\Strategy\CollectionLink' => + 'ApiSkeletons\Doctrine\Hydrator\Strategy\CollectionLinkFactory', + 'ApiSkeletons\Doctrine\Hydrator\Strategy\EntityLink' => + 'ApiSkeletons\Doctrine\Hydrator\Strategy\EntityLinkFactory', ), ), ); diff --git a/phpunit.xml b/phpunit.xml index fccb304..d10cfdd 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,7 +2,7 @@ - ./test/ZFTest + ./test/ApiSkeletonsTest diff --git a/src/CollectionExtract.php b/src/CollectionExtract.php index 423d74b..7028f36 100644 --- a/src/CollectionExtract.php +++ b/src/CollectionExtract.php @@ -1,6 +1,6 @@ getApplication()->run(); $body = json_decode($this->getResponse()->getBody(), true); $this->assertResponseStatusCode(200); - $this->assertEquals('Soft Cell', $body['name']); $this->assertEquals('1', $body['id']); $this->assertEquals('Non-Stop Erotic Cabaret', $body['_embedded']['album'][0]['name']); diff --git a/test/Bootstrap.php b/test/Bootstrap.php index 5c33bab..4016a40 100644 --- a/test/Bootstrap.php +++ b/test/Bootstrap.php @@ -50,7 +50,7 @@ protected static function initAutoloader() 'Laminas\Loader\StandardAutoloader' => array( 'autoregister_zf' => true, 'namespaces' => array( - 'ApiSkeletons\OAuth2\Doctrine\Permissions\Acl' => __DIR__ . '/../src/', + 'ApiSkeletons\\Doctrine\\Hydrator\\Strategy' => __DIR__ . '/../src/', __NAMESPACE__ => __DIR__, ), ), diff --git a/test/TestConfig.php b/test/TestConfig.php index b64c9e0..acd1d9f 100644 --- a/test/TestConfig.php +++ b/test/TestConfig.php @@ -21,10 +21,12 @@ 'Laminas\\ApiTools\\Rest', 'Laminas\\ApiTools\\Rpc', 'Laminas\\ApiTools\\Versioning', + 'DoctrineModule', 'DoctrineORMModule', 'Phpro\DoctrineHydrationModule', 'Laminas\\ApiTools\\Doctrine\\Server', + 'ApiSkeletons\\Doctrine\\Hydrator\\Strategy', 'Db', 'DbApi', diff --git a/test/autoload/local.php b/test/autoload/local.php index e596944..89ebedc 100644 --- a/test/autoload/local.php +++ b/test/autoload/local.php @@ -1,5 +1,9 @@ [ 'connection' => [ @@ -11,4 +15,8 @@ ], ], ], + 'view_manager' => [ + 'display_not_found_reason' => true, + 'display_exceptions' => true, + ], ]; diff --git a/test/module/DbApi/config/module.config.php b/test/module/DbApi/config/module.config.php index bedf744..e59f578 100644 --- a/test/module/DbApi/config/module.config.php +++ b/test/module/DbApi/config/module.config.php @@ -185,7 +185,7 @@ ], ], ], - 'laminas-api-tools' => [ + 'api-tools' => [ 'doctrine-connected' => [ 'DbApi\\V1\\Rest\\Album\\AlbumResource' => [ 'object_manager' => 'doctrine.entitymanager.orm_default', @@ -207,8 +207,8 @@ 'object_manager' => 'doctrine.entitymanager.orm_default', 'by_value' => true, 'strategies' => [ - 'artist' => 'ZF\Doctrine\Hydrator\Strategy\EntityLink', - 'song' => 'ZF\Doctrine\Hydrator\Strategy\CollectionLink', + 'artist' => 'ApiSkeletons\Doctrine\Hydrator\Strategy\EntityLink', + 'song' => 'ApiSkeletons\Doctrine\Hydrator\Strategy\CollectionLink', ], 'use_generated_hydrator' => true, ], @@ -217,7 +217,7 @@ 'object_manager' => 'doctrine.entitymanager.orm_default', 'by_value' => true, 'strategies' => [ - 'album' => 'ZF\Doctrine\Hydrator\Strategy\CollectionExtract', + 'album' => 'ApiSkeletons\Doctrine\Hydrator\Strategy\CollectionExtract', ], 'use_generated_hydrator' => true, ], diff --git a/test/module/DbApi/src/DbApi/Module.php b/test/module/DbApi/src/DbApi/Module.php index ae235a1..9ff2112 100644 --- a/test/module/DbApi/src/DbApi/Module.php +++ b/test/module/DbApi/src/DbApi/Module.php @@ -1,4 +1,5 @@