Code Duplication    Length = 44-44 lines in 2 locations

spec/Message/Location/LocationPatchMessageSpec.php 1 location

@@ 19-62 (lines=44) @@
16
        $this->shouldHaveType(LocationPatchMessage::class);
17
    }
18
19
    function it_should_build()
20
    {
21
        $translation = new LocationTranslationMessage();
22
        $translation->setLocale('en');
23
        $translation->setTitle('Some location');
24
        $translation->setOpeningHours('24/7');
25
26
        $this->setTel('+1 123 456 78 90');
27
        $this->setTel2('+2 456 111 78 90');
28
        $this->setFax('+3 111 222 78 11');
29
        $this->setMail('[email protected]');
30
        $this->setAddress('88 St Patrick St');
31
        $this->setPostalCode('M5T 1V1');
32
        $this->setTown('Toronto');
33
        $this->setCountry('Canada');
34
        $this->setAddressForGoogleMap('88 St Patrick St, Toronto, M5T 1V1, Canada');
35
        $this->setDefaultLocation(true);
36
        $this->setLatitude('43.6527222');
37
        $this->setLongitude('-79.3918831');
38
        $this->addTranslation($translation);
39
40
        $translationData = [
41
            'title'        => 'Some location',
42
            'openingHours' => '24/7',
43
        ];
44
45
        $data = [
46
            'tel'                 => '+1 123 456 78 90',
47
            'tel2'                => '+2 456 111 78 90',
48
            'fax'                 => '+3 111 222 78 11',
49
            'mail'                => '[email protected]',
50
            'address'             => '88 St Patrick St',
51
            'postalCode'          => 'M5T 1V1',
52
            'town'                => 'Toronto',
53
            'country'             => 'Canada',
54
            'addressForGoogleMap' => '88 St Patrick St, Toronto, M5T 1V1, Canada',
55
            'defaultLocation'     => true,
56
            'latitude'            => '43.6527222',
57
            'longitude'           => '-79.3918831',
58
            'translations'        => ['en' => $translationData]
59
        ];
60
61
        $this->build()->shouldReturn($data);
62
    }
63
64
    function it_should_create_from_location(Location $location, LocationTranslation $translation)
65
    {

spec/Message/Location/LocationPostMessageSpec.php 1 location

@@ 17-60 (lines=44) @@
14
        $this->shouldHaveType(LocationPostMessage::class);
15
    }
16
17
    function it_should_build()
18
    {
19
        $translation = new LocationTranslationMessage();
20
        $translation->setLocale('en');
21
        $translation->setTitle('Some location');
22
        $translation->setOpeningHours('24/7');
23
24
        $this->setTel('+1 123 456 78 90');
25
        $this->setTel2('+2 456 111 78 90');
26
        $this->setFax('+3 111 222 78 11');
27
        $this->setMail('[email protected]');
28
        $this->setAddress('88 St Patrick St');
29
        $this->setPostalCode('M5T 1V1');
30
        $this->setTown('Toronto');
31
        $this->setCountry('Canada');
32
        $this->setAddressForGoogleMap('88 St Patrick St, Toronto, M5T 1V1, Canada');
33
        $this->setDefaultLocation(true);
34
        $this->setLatitude('43.6527222');
35
        $this->setLongitude('-79.3918831');
36
        $this->addTranslation($translation);
37
38
        $translationData = [
39
            'title'        => 'Some location',
40
            'openingHours' => '24/7',
41
        ];
42
43
        $data = [
44
            'tel'                 => '+1 123 456 78 90',
45
            'tel2'                => '+2 456 111 78 90',
46
            'fax'                 => '+3 111 222 78 11',
47
            'mail'                => '[email protected]',
48
            'address'             => '88 St Patrick St',
49
            'postalCode'          => 'M5T 1V1',
50
            'town'                => 'Toronto',
51
            'country'             => 'Canada',
52
            'addressForGoogleMap' => '88 St Patrick St, Toronto, M5T 1V1, Canada',
53
            'defaultLocation'     => true,
54
            'latitude'            => '43.6527222',
55
            'longitude'           => '-79.3918831',
56
            'translations'        => ['en' => $translationData]
57
        ];
58
59
        $this->build()->shouldReturn($data);
60
    }
61
}
62