File tree Expand file tree Collapse file tree 6 files changed +8
-11
lines changed Expand file tree Collapse file tree 6 files changed +8
-11
lines changed Original file line number Diff line number Diff line change 17
17
"phpro/grumphp" : " ^2.11" ,
18
18
"phpstan/phpstan" : " ^2.1.8" ,
19
19
"phpstan/phpstan-webmozart-assert" : " ^2.0.0" ,
20
- "phpunit/phpunit" : " ^10.5|^ 11.5|^12.0.7 " ,
20
+ "phpunit/phpunit" : " ^11.5" ,
21
21
"roave/security-advisories" : " dev-master" ,
22
- "symfony/phpunit-bridge" : " 6.1.*|^7.0 "
22
+ "symfony/phpunit-bridge" : " 6.1.*|^7.2 "
23
23
},
24
24
"autoload" : {
25
25
"psr-4" : {
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
<phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3
- xsi : noNamespaceSchemaLocation =" https://schema. phpunit.de/10.5 /phpunit.xsd"
3
+ xsi : noNamespaceSchemaLocation =" vendor/ phpunit/phpunit /phpunit.xsd"
4
4
bootstrap =" ./vendor/autoload.php"
5
5
backupGlobals =" false"
6
6
beStrictAboutOutputDuringTests =" true"
Original file line number Diff line number Diff line change 4
4
5
5
namespace Answear \MwlBundle \Client ;
6
6
7
- use Answear \MwlBundle \ConfigProvider ;
8
7
use Answear \MwlBundle \Request \Request ;
9
8
use GuzzleHttp \Psr7 \Request as HttpRequest ;
10
9
use GuzzleHttp \Psr7 \Uri ;
11
10
12
11
readonly class RequestTransformer
13
12
{
13
+ private const SERVICE_URI = '/mwl ' ;
14
+
14
15
public function __construct (
15
16
private Serializer $ serializer ,
16
17
) {
@@ -20,7 +21,7 @@ public function transform(Request $request): HttpRequest
20
21
{
21
22
return new HttpRequest (
22
23
$ request ->getMethod (),
23
- new Uri (ConfigProvider ::SERVICE_URI . $ request ->getEndpoint ()),
24
+ new Uri (self ::SERVICE_URI . $ request ->getEndpoint ()),
24
25
[
25
26
'Content-type ' => 'application/json ' ,
26
27
],
Original file line number Diff line number Diff line change 6
6
7
7
readonly class ConfigProvider
8
8
{
9
- public const URL = 'https://mwl.meest.com ' ;
10
- public const SERVICE_URI = '/mwl ' ;
9
+ private const URL = 'https://mwl.meest.com ' ;
11
10
12
11
public function __construct (
13
12
private string $ partnerKey ,
Original file line number Diff line number Diff line change 6
6
7
7
use Answear \MwlBundle \Client \RequestTransformer ;
8
8
use Answear \MwlBundle \Client \Serializer ;
9
- use Answear \MwlBundle \ConfigProvider ;
10
9
use Answear \MwlBundle \Request \GetPickupPointsRequest ;
11
10
use Answear \MwlBundle \Request \Request ;
12
11
use PHPUnit \Framework \Attributes \Test ;
@@ -45,6 +44,6 @@ public function requestTransformed(): void
45
44
46
45
private function expectedPath (Request $ request ): string
47
46
{
48
- return ConfigProvider:: SERVICE_URI . $ request ->getEndpoint ();
47
+ return ' /mwl ' . $ request ->getEndpoint ();
49
48
}
50
49
}
Original file line number Diff line number Diff line change @@ -15,8 +15,6 @@ public function gettersAreValid(): void
15
15
{
16
16
$ configuration = new ConfigProvider ('test ' , 'Qwerty123! ' );
17
17
18
- $ this ->assertSame ('https://mwl.meest.com ' , ConfigProvider::URL );
19
- $ this ->assertSame ('/mwl ' , ConfigProvider::SERVICE_URI );
20
18
$ this ->assertSame (
21
19
[
22
20
'base_uri ' => 'https://mwl.meest.com ' ,
You can’t perform that action at this time.
0 commit comments