Code Duplication    Length = 14-16 lines in 7 locations

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

@@ 102-115 (lines=14) @@
99
    /**
100
     * @test
101
     */
102
    public function it_sets_operation_user_and_returns_itself()
103
    {
104
        $request = new UpdateOrderShippingStatusRequest;
105
106
        $this->assertSame($request,
107
            $request->setSellerId('SELLER_ID')
108
                ->setOrderId('ORDER_ID')
109
                ->setIsPointFix(true)
110
                ->setShipStatus(ShipStatus::SHIPPABLE())
111
                ->setOperationUser('OPERATION_USER'));
112
        $simpleXml = simplexml_load_string($request->getParams());
113
114
        $this->assertEquals('OPERATION_USER', $simpleXml->Target->OperationUser->__toString());
115
    }
116
117
    /**
118
     * @test
@@ 191-204 (lines=14) @@
188
    /**
189
     * @test
190
     */
191
    public function it_sets_ship_notes_and_returns_itself()
192
    {
193
        $request = new UpdateOrderShippingStatusRequest;
194
195
        $this->assertSame($request,
196
            $request->setSellerId('SELLER_ID')
197
                ->setOrderId('ORDER_ID')
198
                ->setIsPointFix(false)
199
                ->setShipStatus(ShipStatus::SHIPPABLE())
200
                ->setShipNotes('SHIP_NOTES'));
201
        $simpleXml = simplexml_load_string($request->getParams());
202
203
        $this->assertEquals('SHIP_NOTES', $simpleXml->Order->Ship->ShipNotes->__toString());
204
    }
205
206
    /**
207
     * @test
@@ 232-245 (lines=14) @@
229
    /**
230
     * @test
231
     */
232
    public function it_sets_ship_invoice_number1_and_returns_itself()
233
    {
234
        $request = new UpdateOrderShippingStatusRequest;
235
236
        $this->assertSame($request,
237
            $request->setSellerId('SELLER_ID')
238
                ->setOrderId('ORDER_ID')
239
                ->setIsPointFix(false)
240
                ->setShipStatus(ShipStatus::SHIPPABLE())
241
                ->setShipInvoiceNumber1('SHIP_INVOICE_NUMBER1'));
242
        $simpleXml = simplexml_load_string($request->getParams());
243
244
        $this->assertEquals('SHIP_INVOICE_NUMBER1', $simpleXml->Order->Ship->ShipInvoiceNumber1->__toString());
245
    }
246
247
    /**
248
     * @test
@@ 262-275 (lines=14) @@
259
    /**
260
     * @test
261
     */
262
    public function it_sets_ship_invoice_number2_and_returns_itself()
263
    {
264
        $request = new UpdateOrderShippingStatusRequest;
265
266
        $this->assertSame($request,
267
            $request->setSellerId('SELLER_ID')
268
                ->setOrderId('ORDER_ID')
269
                ->setIsPointFix(false)
270
                ->setShipStatus(ShipStatus::SHIPPABLE())
271
                ->setShipInvoiceNumber2('SHIP_INVOICE_NUMBER2'));
272
        $simpleXml = simplexml_load_string($request->getParams());
273
274
        $this->assertEquals('SHIP_INVOICE_NUMBER2', $simpleXml->Order->Ship->ShipInvoiceNumber2->__toString());
275
    }
276
277
    /**
278
     * @test
@@ 292-305 (lines=14) @@
289
    /**
290
     * @test
291
     */
292
    public function it_sets_ship_url_and_returns_itself()
293
    {
294
        $request = new UpdateOrderShippingStatusRequest;
295
296
        $this->assertSame($request,
297
            $request->setSellerId('SELLER_ID')
298
                ->setOrderId('ORDER_ID')
299
                ->setIsPointFix(false)
300
                ->setShipStatus(ShipStatus::SHIPPABLE())
301
                ->setShipUrl('https://hogehoge'));
302
        $simpleXml = simplexml_load_string($request->getParams());
303
304
        $this->assertEquals('![CDATA[https://hogehoge]]', $simpleXml->Order->Ship->ShipUrl->__toString());
305
    }
306
307
    /**
308
     * @test
@@ 322-337 (lines=16) @@
319
    /**
320
     * @test
321
     */
322
    public function it_sets_ship_date_and_returns_itself()
323
    {
324
        $request = new UpdateOrderShippingStatusRequest;
325
326
        date_default_timezone_set('UTC');
327
328
        $this->assertSame($request,
329
            $request->setSellerId('SELLER_ID')
330
                ->setOrderId('ORDER_ID')
331
                ->setIsPointFix(false)
332
                ->setShipStatus(ShipStatus::SHIPPABLE())
333
                ->setShipDate(new DateTimeImmutable('2017-04-11 20:00:00')));
334
        $simpleXml = simplexml_load_string($request->getParams());
335
336
        $this->assertEquals('20170412', $simpleXml->Order->Ship->ShipDate->__toString());
337
    }
338
339
    /**
340
     * @test
@@ 354-369 (lines=16) @@
351
    /**
352
     * @test
353
     */
354
    public function it_sets_arrival_date_and_returns_itself()
355
    {
356
        $request = new UpdateOrderShippingStatusRequest;
357
358
        date_default_timezone_set('UTC');
359
360
        $this->assertSame($request,
361
            $request->setSellerId('SELLER_ID')
362
                ->setOrderId('ORDER_ID')
363
                ->setIsPointFix(false)
364
                ->setShipStatus(ShipStatus::SHIPPABLE())
365
                ->setArrivalDate(new DateTimeImmutable('2017-04-11 20:00:00')));
366
        $simpleXml = simplexml_load_string($request->getParams());
367
368
        $this->assertEquals('20170412', $simpleXml->Order->Ship->ArrivalDate->__toString());
369
    }
370
371
    /**
372
     * @test