Skip to content

Commit 01f4b25

Browse files
committed
Fixed failing test, and moved to full-on PSR-4 structure
- Failing test due to improperly resolved class names; resolved them. - Moved `Module` and `ModuleTest` to their respective `src/` and `test/` directories, where they belong, and removed the classmap autoloader definition for the former.
1 parent 8e00f59 commit 01f4b25

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

composer.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@
4242
"autoload": {
4343
"psr-4": {
4444
"ZF\\ApiProblem\\": "src/"
45-
},
46-
"classmap": [
47-
"Module.php"
48-
]
45+
}
4946
},
5047
"autoload-dev": {
5148
"psr-4": {

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpcs.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@
1919
<file>config</file>
2020
<file>src</file>
2121
<file>test</file>
22-
<file>Module.php</file>
2322
</ruleset>

Module.php renamed to src/Module.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function onBootstrap(MvcEvent $e)
3939
$serviceManager = $app->getServiceManager();
4040
$eventManager = $app->getEventManager();
4141

42-
$serviceManager->get(ApiProblemListener::class)->attach($eventmanager);
42+
$serviceManager->get(Listener\ApiProblemListener::class)->attach($eventManager);
4343
$eventManager->attach(MvcEvent::EVENT_RENDER, [$this, 'onRender'], 100);
4444

4545
$sendResponseListener = $serviceManager->get('SendResponseListener');
@@ -68,7 +68,7 @@ public function onRender(MvcEvent $e)
6868

6969
// register at high priority, to "beat" normal json strategy registered
7070
// via view manager, as well as HAL strategy.
71-
$services->get(ApiProblemStrategy::class)->attach($events, 400);
71+
$services->get(View\ApiProblemStrategy::class)->attach($events, 400);
7272
}
7373
}
7474
}

ModuleTest.php renamed to test/ModuleTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
2-
32
/**
4-
* Creator: adamgrabek
5-
* Date: 08.06.2016
6-
* Time: 00:06.
3+
* @link http://github.com/zfcampus/zf-api-problem for the canonical source repository
4+
* @copyright Copyright (c) 2014-2016 Zend Technologies USA Inc. (http://www.zend.com)
5+
* @license http://framework.zend.com/license/new-bsd New BSD License
76
*/
87

8+
99
namespace ZF\ApiProblem;
1010

1111
use PHPUnit_Framework_TestCase as TestCase;
@@ -50,7 +50,7 @@ public function serviceLocator($service)
5050

5151
return $listener;
5252
break;
53-
case SendApiProblemResponseListener::class :
53+
case SendApiProblemResponseListener::class:
5454
return new SendApiProblemResponseListener();
5555
default:
5656
//

0 commit comments

Comments
 (0)