Code Duplication    Length = 11-12 lines in 4 locations

tests/PaymentSlipPdfTest.php 4 locations

@@ 268-279 (lines=12) @@
265
     * @expectedExceptionMessage $element contains not "lines" key!
266
     * @covers ::writePaymentSlipLines
267
     */
268
    public function testWritePaymentSlipLinesNoLinesKey()
269
    {
270
        $method = $this->makeMethodAccessible(
271
            'SwissPaymentSlip\SwissPaymentSlipPdf\Tests\TestablePaymentSlipPdf',
272
            'writePaymentSlipLines'
273
        );
274
        $method->invoke(
275
            $paymentSlipPdf = new TestablePaymentSlipPdf((object)'FooBar'),
276
            'elementName',
277
            ['attributes' => []]
278
        );
279
    }
280
281
    /**
282
     * Tests the writePaymentSlipLines method with no 'attributes' key
@@ 289-299 (lines=11) @@
286
     * @expectedExceptionMessage $element contains not "attributes" key!
287
     * @covers ::writePaymentSlipLines
288
     */
289
    public function testWritePaymentSlipLinesNoAttributesKey()
290
    {
291
        $method = $this->makeMethodAccessible(
292
            'SwissPaymentSlip\SwissPaymentSlipPdf\Tests\TestablePaymentSlipPdf',
293
            'writePaymentSlipLines'
294
        );
295
        $method->invoke(
296
            $paymentSlipPdf = new TestablePaymentSlipPdf((object)'FooBar'),
297
            'elementName', ['lines' => []]
298
        );
299
    }
300
301
    /**
302
     * Tests the writePaymentSlipLines method with 'lines' key being no array
@@ 309-319 (lines=11) @@
306
     * @expectedExceptionMessage $lines is not an array!
307
     * @covers ::writePaymentSlipLines
308
     */
309
    public function testWritePaymentSlipLinesLinesKeyNoArray()
310
    {
311
        $method = $this->makeMethodAccessible(
312
            'SwissPaymentSlip\SwissPaymentSlipPdf\Tests\TestablePaymentSlipPdf',
313
            'writePaymentSlipLines'
314
        );
315
        $method->invoke(
316
            $paymentSlipPdf = new TestablePaymentSlipPdf((object)'FooBar'),
317
            'elementName', ['lines' => 'notAnArray', 'attributes' => []]
318
        );
319
    }
320
321
    /**
322
     * Tests the writePaymentSlipLines method with 'attributes' key being no array
@@ 329-340 (lines=12) @@
326
     * @expectedExceptionMessage $attributes is not an array!
327
     * @covers ::writePaymentSlipLines
328
     */
329
    public function testWritePaymentSlipLinesAttributesKeyNoArray()
330
    {
331
        $method = $this->makeMethodAccessible(
332
            'SwissPaymentSlip\SwissPaymentSlipPdf\Tests\TestablePaymentSlipPdf',
333
            'writePaymentSlipLines'
334
        );
335
        $method->invoke(
336
            $paymentSlipPdf = new TestablePaymentSlipPdf((object)'FooBar'),
337
            'elementName',
338
            ['lines' => [], 'attributes' => 'notAnArray']
339
        );
340
    }
341
342
    /**
343
     * Make a protected method public using the Reflection API