Skip to content

Commit 23cb6d2

Browse files
committed
Use the new Constants
1 parent 99e0bc6 commit 23cb6d2

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

tests/XmlEncodeMiddlewareTest.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
namespace ApiClients\Tests\Middleware\Xml;
44

5-
use ApiClients\Middleware\Json\JsonStream;
6-
use ApiClients\Middleware\Json\JsonEncodeMiddleware;
75
use ApiClients\Middleware\Xml\XmlEncodeMiddleware;
86
use ApiClients\Middleware\Xml\XmlStream;
9-
use ApiClients\Tools\Json\JsonEncodeService;
107
use ApiClients\Tools\TestUtilities\TestCase;
118
use React\EventLoop\Factory;
129
use RingCentral\Psr7\BufferStream;
@@ -19,16 +16,12 @@ public function testPre()
1916
{
2017
$loop = Factory::create();
2118
$middleware = new XmlEncodeMiddleware();
22-
$stream = new XmlStream([
23-
'foo' => [
24-
'bar' => 'beer',
25-
],
26-
]);
19+
$stream = new XmlStream(Constant::TREE);
2720
$request = new Request('GET', 'https://example.com', [], $stream);
2821

2922
$modifiedRequest = await($middleware->pre($request, 'abc'), $loop);
3023
self::assertSame(
31-
'<?xml version="1.0" encoding="UTF-8"?><foo><bar>beer</bar></foo>',
24+
Constant::XML,
3225
(string) $modifiedRequest->getBody()
3326
);
3427
self::assertTrue($modifiedRequest->hasHeader('Content-Type'));

0 commit comments

Comments
 (0)