Code Duplication    Length = 14-16 lines in 8 locations

tests/unit/YahooShoppingJp/Request/UpdateOrderShippingStatusRequestTest.php 8 locations

@@ 101-114 (lines=14) @@
98
    /**
99
     * @test
100
     */
101
    public function it_sets_operation_user_and_returns_itself()
102
    {
103
        $request = new UpdateOrderShippingStatusRequest;
104
105
        $this->assertSame($request,
106
            $request->setSellerId('SELLER_ID')
107
                ->setOrderId('ORDER_ID')
108
                ->setIsPointFix(true)
109
                ->setShipStatus(ShipStatus::SHIPPABLE())
110
                ->setOperationUser('OPERATION_USER'));
111
        $simpleXml = simplexml_load_string($request->getParams());
112
113
        $this->assertEquals('OPERATION_USER', $simpleXml->Target->OperationUser->__toString());
114
    }
115
116
    /**
117
     * @test
@@ 160-173 (lines=14) @@
157
    /**
158
     * @test
159
     */
160
    public function it_sets_ship_method_and_returns_itself()
161
    {
162
        $request = new UpdateOrderShippingStatusRequest;
163
164
        $this->assertSame($request,
165
            $request->setSellerId('SELLER_ID')
166
                ->setOrderId('ORDER_ID')
167
                ->setIsPointFix(false)
168
                ->setShipStatus(ShipStatus::SHIPPABLE())
169
                ->setShipMethod('postage16'));
170
        $simpleXml = simplexml_load_string($request->getParams());
171
172
        $this->assertEquals('postage16', $simpleXml->Order->Ship->ShipMethod->__toString());
173
    }
174
175
    /**
176
     * @test
@@ 200-213 (lines=14) @@
197
    /**
198
     * @test
199
     */
200
    public function it_sets_ship_notes_and_returns_itself()
201
    {
202
        $request = new UpdateOrderShippingStatusRequest;
203
204
        $this->assertSame($request,
205
            $request->setSellerId('SELLER_ID')
206
                ->setOrderId('ORDER_ID')
207
                ->setIsPointFix(false)
208
                ->setShipStatus(ShipStatus::SHIPPABLE())
209
                ->setShipNotes('SHIP_NOTES'));
210
        $simpleXml = simplexml_load_string($request->getParams());
211
212
        $this->assertEquals('SHIP_NOTES', $simpleXml->Order->Ship->ShipNotes->__toString());
213
    }
214
215
    /**
216
     * @test
@@ 250-263 (lines=14) @@
247
    /**
248
     * @test
249
     */
250
    public function it_sets_ship_invoice_number1_and_returns_itself()
251
    {
252
        $request = new UpdateOrderShippingStatusRequest;
253
254
        $this->assertSame($request,
255
            $request->setSellerId('SELLER_ID')
256
                ->setOrderId('ORDER_ID')
257
                ->setIsPointFix(false)
258
                ->setShipStatus(ShipStatus::SHIPPABLE())
259
                ->setShipInvoiceNumber1('SHIP_INVOICE_NUMBER1'));
260
        $simpleXml = simplexml_load_string($request->getParams());
261
262
        $this->assertEquals('SHIP_INVOICE_NUMBER1', $simpleXml->Order->Ship->ShipInvoiceNumber1->__toString());
263
    }
264
265
    /**
266
     * @test
@@ 280-293 (lines=14) @@
277
    /**
278
     * @test
279
     */
280
    public function it_sets_ship_invoice_number2_and_returns_itself()
281
    {
282
        $request = new UpdateOrderShippingStatusRequest;
283
284
        $this->assertSame($request,
285
            $request->setSellerId('SELLER_ID')
286
                ->setOrderId('ORDER_ID')
287
                ->setIsPointFix(false)
288
                ->setShipStatus(ShipStatus::SHIPPABLE())
289
                ->setShipInvoiceNumber2('SHIP_INVOICE_NUMBER2'));
290
        $simpleXml = simplexml_load_string($request->getParams());
291
292
        $this->assertEquals('SHIP_INVOICE_NUMBER2', $simpleXml->Order->Ship->ShipInvoiceNumber2->__toString());
293
    }
294
295
    /**
296
     * @test
@@ 310-323 (lines=14) @@
307
    /**
308
     * @test
309
     */
310
    public function it_sets_ship_url_and_returns_itself()
311
    {
312
        $request = new UpdateOrderShippingStatusRequest;
313
314
        $this->assertSame($request,
315
            $request->setSellerId('SELLER_ID')
316
                ->setOrderId('ORDER_ID')
317
                ->setIsPointFix(false)
318
                ->setShipStatus(ShipStatus::SHIPPABLE())
319
                ->setShipUrl('https://hogehoge'));
320
        $simpleXml = simplexml_load_string($request->getParams());
321
322
        $this->assertEquals('![CDATA[https://hogehoge]]', $simpleXml->Order->Ship->ShipUrl->__toString());
323
    }
324
325
    /**
326
     * @test
@@ 340-355 (lines=16) @@
337
    /**
338
     * @test
339
     */
340
    public function it_sets_ship_date_and_returns_itself()
341
    {
342
        $request = new UpdateOrderShippingStatusRequest;
343
344
        date_default_timezone_set('UTC');
345
346
        $this->assertSame($request,
347
            $request->setSellerId('SELLER_ID')
348
                ->setOrderId('ORDER_ID')
349
                ->setIsPointFix(false)
350
                ->setShipStatus(ShipStatus::SHIPPABLE())
351
                ->setShipDate(new DateTimeImmutable('2017-04-11 20:00:00')));
352
        $simpleXml = simplexml_load_string($request->getParams());
353
354
        $this->assertEquals('20170412', $simpleXml->Order->Ship->ShipDate->__toString());
355
    }
356
357
    /**
358
     * @test
@@ 372-387 (lines=16) @@
369
    /**
370
     * @test
371
     */
372
    public function it_sets_arrival_date_and_returns_itself()
373
    {
374
        $request = new UpdateOrderShippingStatusRequest;
375
376
        date_default_timezone_set('UTC');
377
378
        $this->assertSame($request,
379
            $request->setSellerId('SELLER_ID')
380
                ->setOrderId('ORDER_ID')
381
                ->setIsPointFix(false)
382
                ->setShipStatus(ShipStatus::SHIPPABLE())
383
                ->setArrivalDate(new DateTimeImmutable('2017-04-11 20:00:00')));
384
        $simpleXml = simplexml_load_string($request->getParams());
385
386
        $this->assertEquals('20170412', $simpleXml->Order->Ship->ArrivalDate->__toString());
387
    }
388
389
    /**
390
     * @test