Skip to content

Commit 9f3ccb4

Browse files
committed
fix(update) : Compatibility with wollanup/php-api-rest 2.1
1 parent 86a2d6c commit 9f3ccb4

File tree

3 files changed

+139
-83
lines changed

3 files changed

+139
-83
lines changed

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
"Util\\": "tests/util/"
2525
}
2626
},
27-
"require": {
28-
"propel/propel": "~2.0@dev",
29-
"wollanup/php-api-rest-interfaces": "^1.2.1"
30-
},
3127
"require-dev": {
32-
"phpunit/phpunit": "^6.0"
28+
"ext-sqlite3": "*",
29+
"wollanup/php-api-rest": "dev-master",
30+
"phpunit/phpunit": "^6.0",
31+
"propel/propel": "~2.0@dev",
32+
"slim/slim": "3.*"
3333
}
3434
}

tests/util/ContainerMock.php

Lines changed: 61 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
namespace Eukles\Container {
3-
3+
44
use Eukles\Config\ConfigInterface;
55
use Eukles\Entity\EntityFactoryInterface;
66
use Eukles\Service\Pagination\RequestPaginationInterface;
@@ -10,108 +10,148 @@
1010
use Eukles\Service\RoutesClasses\RoutesClassesInterface;
1111
use Eukles\Slim\Handlers\ActionErrorInterface;
1212
use Eukles\Slim\Handlers\EntityRequestErrorInterface;
13+
use Psr\Container\ContainerExceptionInterface;
14+
use Psr\Container\NotFoundExceptionInterface;
15+
use Psr\Http\Message\ResponseInterface;
1316
use Psr\Http\Message\ServerRequestInterface;
14-
use Slim\Interfaces\RouterInterface;
15-
17+
1618
class ContainerMock implements ContainerInterface
1719
{
18-
20+
1921
/**
2022
* @inheritdoc
2123
*/
22-
public function get($id) { }
23-
24+
public function has($id) { }
25+
2426
/**
2527
* @return ActionErrorInterface
2628
*/
2729
public function getActionErrorHandler(): ActionErrorInterface
2830
{
2931
// TODO: Implement getActionErrorHandler() method.
3032
}
31-
33+
3234
/**
3335
* @return ConfigInterface
3436
*/
3537
public function getConfig(): ConfigInterface
3638
{
3739
// TODO: Implement getConfig() method.
3840
}
39-
41+
4042
/**
4143
* @return EntityFactoryInterface
4244
*/
4345
public function getEntityFactory(): EntityFactoryInterface
4446
{
4547
// TODO: Implement getEntityFactory() method.
4648
}
47-
49+
4850
/**
4951
* @return EntityRequestErrorInterface
5052
*/
5153
public function getEntityRequestErrorHandler(): EntityRequestErrorInterface
5254
{
5355
// TODO: Implement getEntityRequestErrorHandler() method.
5456
}
55-
57+
5658
/**
5759
* @return ServerRequestInterface
5860
*/
5961
public function getRequest(): ServerRequestInterface
6062
{
6163
// TODO: Implement getRequest() method.
6264
}
63-
65+
6466
/**
6567
* @return RequestPaginationInterface
6668
*/
6769
public function getRequestPagination(): RequestPaginationInterface
6870
{
6971
// TODO: Implement getRequestPagination() method.
7072
}
71-
73+
7274
/**
7375
* @return RequestQueryModifierInterface
7476
*/
7577
public function getRequestQueryModifier(): RequestQueryModifierInterface
7678
{
7779
// TODO: Implement getRequestQueryModifier() method.
7880
}
79-
81+
82+
/**
83+
* @return ResponseInterface
84+
*/
85+
public function getResponse(): ResponseInterface
86+
{
87+
// TODO: Implement getResponse() method.
88+
}
89+
8090
/**
8191
* @return ResponseBuilderInterface
8292
*/
8393
public function getResponseBuilder(): ResponseBuilderInterface
8494
{
8595
// TODO: Implement getResponseBuilder() method.
8696
}
87-
97+
8898
/**
8999
* @return ResponseFormatterInterface
90100
*/
91101
public function getResponseFormatter(): ResponseFormatterInterface
92102
{
93103
// TODO: Implement getResponseFormatter() method.
94104
}
95-
105+
106+
/**
107+
* Result is populated in ActionStrategy and becomes available in middlewares post-app
108+
*
109+
* @return mixed
110+
*/
111+
public function getResult()
112+
{
113+
// TODO: Implement getResult() method.
114+
}
115+
96116
/**
97-
* @return RouterInterface
117+
* @param $result
118+
*
119+
* @return void
98120
*/
99-
public function getRouter(): RouterInterface
121+
public function setResult($result)
122+
{
123+
// TODO: Implement setResult() method.
124+
}
125+
126+
/**
127+
* @return \Eukles\Service\Router\RouterInterface
128+
*/
129+
public function getRouter(): \Eukles\Service\Router\RouterInterface
100130
{
101131
// TODO: Implement getRouter() method.
102132
}
103-
133+
104134
/**
105135
* @return RoutesClassesInterface
106136
*/
107137
public function getRoutesClasses(): RoutesClassesInterface
108138
{
109139
// TODO: Implement getRoutesClasses() method.
110140
}
111-
141+
112142
/**
113-
* @inheritdoc
143+
* Finds an entry of the container by its identifier and returns it.
144+
*
145+
* @param string $id Identifier of the entry to look for.
146+
*
147+
* @throws NotFoundExceptionInterface No entry was found for **this** identifier.
148+
* @throws ContainerExceptionInterface Error while retrieving the entry.
149+
*
150+
* @return mixed Entry.
114151
*/
115-
public function has($id) { }
152+
public function get($id)
153+
{
154+
// TODO: Implement get() method.
155+
}
116156
}
117157
}

0 commit comments

Comments
 (0)