Code Duplication    Length = 8-14 lines in 4 locations

tests/ArchangelTest.php 4 locations

@@ 240-247 (lines=8) @@
237
        $this->assertArraySubset(array('Reply-To' => '"Mr. Test Alot" <[email protected]>'), $headers);
238
    }
239
240
    public function testFormatEmailAddress()
241
    {
242
        $archangel = new Archangel();
243
        $formatMethod = $this->getProtectedMethod('formatEmailAddress');
244
        $formattedEmail = $formatMethod->invokeArgs($archangel, array('[email protected]', ''));
245
246
        $this->assertEquals('[email protected]', $formattedEmail);
247
    }
248
249
    public function testFormatEmailAddressWithTitle()
250
    {
@@ 249-256 (lines=8) @@
246
        $this->assertEquals('[email protected]', $formattedEmail);
247
    }
248
249
    public function testFormatEmailAddressWithTitle()
250
    {
251
        $archangel = new Archangel();
252
        $formatMethod = $this->getProtectedMethod('formatEmailAddress');
253
        $formattedEmail = $formatMethod->invokeArgs($archangel, array('[email protected]', 'Mr. Test Alot'));
254
255
        $this->assertEquals('"Mr. Test Alot" <[email protected]>', $formattedEmail);
256
    }
257
258
    public function testSetSubject()
259
    {
@@ 502-515 (lines=14) @@
499
        $this->assertEquals('[email protected], [email protected]', $toAddresses);
500
    }
501
502
    public function testBuildPlainMessageHeader()
503
    {
504
        $expectedMessageHeader = array(
505
            'Content-Type: text/plain; charset="iso-8859"',
506
            'Content-Transfer-Encoding: 7bit',
507
            '',
508
        );
509
510
        $archangel = new Archangel();
511
        $buildMethod = $this->getProtectedMethod('buildPlainMessageHeader');
512
        $messageHeader = $buildMethod->invoke($archangel);
513
514
        $this->assertEquals($expectedMessageHeader, $messageHeader);
515
    }
516
517
    public function testBuildHtmlMessageHeader()
518
    {
@@ 517-530 (lines=14) @@
514
        $this->assertEquals($expectedMessageHeader, $messageHeader);
515
    }
516
517
    public function testBuildHtmlMessageHeader()
518
    {
519
        $expectedMessageHeader = array(
520
            'Content-Type: text/html; charset="iso-8859-1"',
521
            'Content-Transfer-Encoding: 7bit',
522
            '',
523
        );
524
525
        $archangel = new Archangel();
526
        $buildMethod = $this->getProtectedMethod('buildHtmlMessageHeader');
527
        $messageHeader = $buildMethod->invoke($archangel);
528
529
        $this->assertEquals($expectedMessageHeader, $messageHeader);
530
    }
531
532
    /**
533
     * @dataProvider dataBuildHeaders