Completed
Push — master ( 492c01...a71ec3 )
by Avtandil
02:50
created

DeclensionsTest::dataForDeclension4()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 89

Duplication

Lines 89
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 89
loc 89
rs 8.24
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
declare(strict_types=1);
4
5
namespace Tests\Unit\Support;
6
7
use Longman\LaravelLodash\Support\Declensions;
8
use Tests\Unit\TestCase;
9
10
class DeclensionsTest extends TestCase
0 ignored issues
show
Bug introduced by
There is at least one abstract method in this class. Maybe declare it as abstract, or implement the remaining methods: artisan, be, call, seed
Loading history...
11
{
12
    /**
13
     * @dataProvider dataForDeclension3()
14
     * @test
15
     */
16
    public function turn_words_declension3(string $word, string $turned): void
17
    {
18
        $this->assertSame($turned, Declensions::applyDeclension($word, Declensions::DECLENSION_3));
19
    }
20
21
    /**
22
     * @dataProvider dataForDeclension4()
23
     * @test
24
     */
25
    public function turn_words_declension4(string $word, string $turned): void
26
    {
27
        $this->assertSame($turned, Declensions::applyDeclension($word, Declensions::DECLENSION_4));
28
    }
29
30
    /**
31
     * Data provider
32
     *
33
     * @see turn_words_declension3()
34
     */
35 View Code Duplication
    public function dataForDeclension3(): array
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
36
    {
37
        return [
38
            'ად' => [
39
                'word'   => 'მოჰამმად',
40
                'turned' => 'მოჰამმადს',
41
            ],
42
            'ან' => [
43
                'word'   => 'მარქარიან',
44
                'turned' => 'მარქარიანს',
45
            ],
46
            'დე' => [
47
                'word'   => 'მენაბდე',
48
                'turned' => 'მენაბდეს',
49
            ],
50
            'დი' => [
51
                'word'   => 'მაჰდი',
52
                'turned' => 'მაჰდის',
53
            ],
54
            'ვა' => [
55
                'word'   => 'სიჭინავა',
56
                'turned' => 'სიჭინავას',
57
            ],
58
            'ვი' => [
59
                'word'   => 'ბარნოვი',
60
                'turned' => 'ბარნოვს',
61
            ],
62
            'ია' => [
63
                'word'   => 'დანელია',
64
                'turned' => 'დანელიას',
65
            ],
66
            'კა' => [
67
                'word'   => 'ოდინაკა',
68
                'turned' => 'ოდინაკას',
69
            ],
70
            'კი' => [
71
                'word'   => 'კანდელაკი',
72
                'turned' => 'კანდელაკს',
73
            ],
74
            'კო' => [
75
                'word'   => 'ბოიჩენკო',
76
                'turned' => 'ბოიჩენკოს',
77
            ],
78
            'ლი' => [
79
                'word'   => 'ქევხიშვილი',
80
                'turned' => 'ქევხიშვილს',
81
            ],
82
            'ნი' => [
83
                'word'   => 'გელბახიანი',
84
                'turned' => 'გელბახიანს',
85
            ],
86
            'რი' => [
87
                'word'   => 'თაბაგარი',
88
                'turned' => 'თაბაგარს',
89
            ],
90
            'სი' => [
91
                'word'   => 'მეღვინეთუხუცესი',
92
                'turned' => 'მეღვინეთუხუცესს',
93
            ],
94
            'ტი' => [
95
                'word'   => 'ღლონტი',
96
                'turned' => 'ღლონტს',
97
            ],
98
            'უა' => [
99
                'word'   => 'თოდუა',
100
                'turned' => 'თოდუას',
101
            ],
102
            'ში' => [
103
                'word'   => 'ტუღუში',
104
                'turned' => 'ტუღუშს',
105
            ],
106
            'ცი' => [
107
                'word'   => 'ახალკაცი',
108
                'turned' => 'ახალკაცს',
109
            ],
110
            'ძე' => [
111
                'word'   => 'კიკაბიძე',
112
                'turned' => 'კიკაბიძეს',
113
            ],
114
            'ხი' => [
115
                'word'   => 'მესხი',
116
                'turned' => 'მესხს',
117
            ],
118
            '*'  => [
119
                'word'   => 'ბჰაილალბჰაი',
120
                'turned' => 'ბჰაილალბჰაის',
121
            ],
122
        ];
123
    }
124
125
    /**
126
     * Data provider
127
     *
128
     * @see turn_words_declension4()
129
     */
130 View Code Duplication
    public function dataForDeclension4(): array
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
131
    {
132
        return [
133
            'ად' => [
134
                'word'   => 'მოჰამმად',
135
                'turned' => 'მოჰამმადის',
136
            ],
137
            'ან' => [
138
                'word'   => 'მარქარიან',
139
                'turned' => 'მარქარიანის',
140
            ],
141
            'დე' => [
142
                'word'   => 'მენაბდე',
143
                'turned' => 'მენაბდის',
144
            ],
145
            'დი' => [
146
                'word'   => 'მაჰდი',
147
                'turned' => 'მაჰდის',
148
            ],
149
            'ვა' => [
150
                'word'   => 'სიჭინავა',
151
                'turned' => 'სიჭინავას',
152
            ],
153
            'ვი' => [
154
                'word'   => 'ბარნოვი',
155
                'turned' => 'ბარნოვის',
156
            ],
157
            'ია' => [
158
                'word'   => 'დანელია',
159
                'turned' => 'დანელიას',
160
            ],
161
            'კა' => [
162
                'word'   => 'ოდინაკა',
163
                'turned' => 'ოდინაკას',
164
            ],
165
            'კი' => [
166
                'word'   => 'კანდელაკი',
167
                'turned' => 'კანდელაკის',
168
            ],
169
            'კო' => [
170
                'word'   => 'ბოიჩენკო',
171
                'turned' => 'ბოიჩენკოს',
172
            ],
173
            'ლი' => [
174
                'word'   => 'ქევხიშვილი',
175
                'turned' => 'ქევხიშვილის',
176
            ],
177
            'ნი' => [
178
                'word'   => 'გელბახიანი',
179
                'turned' => 'გელბახიანის',
180
            ],
181
            'რი' => [
182
                'word'   => 'თაბაგარი',
183
                'turned' => 'თაბაგარის',
184
            ],
185
            'სი' => [
186
                'word'   => 'მეღვინეთუხუცესი',
187
                'turned' => 'მეღვინეთუხუცესის',
188
            ],
189
            'ტი' => [
190
                'word'   => 'ღლონტი',
191
                'turned' => 'ღლონტის',
192
            ],
193
            'უა' => [
194
                'word'   => 'თოდუა',
195
                'turned' => 'თოდუას',
196
            ],
197
            'ში' => [
198
                'word'   => 'ტუღუში',
199
                'turned' => 'ტუღუშის',
200
            ],
201
            'ცი' => [
202
                'word'   => 'ახალკაცი',
203
                'turned' => 'ახალკაცის',
204
            ],
205
            'ძე' => [
206
                'word'   => 'კიკაბიძე',
207
                'turned' => 'კიკაბიძის',
208
            ],
209
            'ხი' => [
210
                'word'   => 'მესხი',
211
                'turned' => 'მესხის',
212
            ],
213
            '*'  => [
214
                'word'   => 'ბჰაილალბჰაი',
215
                'turned' => 'ბჰაილალბჰაის',
216
            ],
217
        ];
218
    }
219
}
220