Code Duplication    Length = 19-19 lines in 4 locations

spec/Felixkiss/UniqueWithValidator/ValidatorSpec.php 4 locations

@@ 118-136 (lines=19) @@
115
        )->shouldHaveBeenCalled();
116
    }
117
118
    function it_reads_implicit_integer_ignore_id_with_default_column_name()
119
    {
120
        $this->validateData(
121
            ['first_name' => 'unique_with:users,last_name,1'],
122
            [
123
                'first_name' => 'Foo',
124
                'last_name' => 'Bar',
125
            ]
126
        );
127
128
        $this->presenceVerifier->getCount(
129
            'users',
130
            'first_name',
131
            'Foo',
132
            1,
133
            null,
134
            ['last_name' => 'Bar']
135
        )->shouldHaveBeenCalled();
136
    }
137
138
    function it_reads_implicit_integer_ignore_id_with_custom_column_name()
139
    {
@@ 138-156 (lines=19) @@
135
        )->shouldHaveBeenCalled();
136
    }
137
138
    function it_reads_implicit_integer_ignore_id_with_custom_column_name()
139
    {
140
        $this->validateData(
141
            ['first_name' => 'unique_with:users,first_name,last_name,1 = UserKey'],
142
            [
143
                'first_name' => 'Foo',
144
                'last_name' => 'Bar',
145
            ]
146
        );
147
148
        $this->presenceVerifier->getCount(
149
            'users',
150
            'first_name',
151
            'Foo',
152
            1,
153
            'UserKey',
154
            ['last_name' => 'Bar']
155
        )->shouldHaveBeenCalled();
156
    }
157
158
    function it_reads_explicit_ignore_id_with_default_column_name()
159
    {
@@ 158-176 (lines=19) @@
155
        )->shouldHaveBeenCalled();
156
    }
157
158
    function it_reads_explicit_ignore_id_with_default_column_name()
159
    {
160
        $this->validateData(
161
            ['first_name' => 'unique_with:users,last_name,ignore:1'],
162
            [
163
                'first_name' => 'Foo',
164
                'last_name' => 'Bar',
165
            ]
166
        );
167
168
        $this->presenceVerifier->getCount(
169
            'users',
170
            'first_name',
171
            'Foo',
172
            1,
173
            null,
174
            ['last_name' => 'Bar']
175
        )->shouldHaveBeenCalled();
176
    }
177
178
    function it_reads_explicit_ignore_id_with_custom_column_name()
179
    {
@@ 178-196 (lines=19) @@
175
        )->shouldHaveBeenCalled();
176
    }
177
178
    function it_reads_explicit_ignore_id_with_custom_column_name()
179
    {
180
        $this->validateData(
181
            ['first_name' => 'unique_with:users,first_name,last_name,ignore:1 = UserKey'],
182
            [
183
                'first_name' => 'Foo',
184
                'last_name' => 'Bar',
185
            ]
186
        );
187
188
        $this->presenceVerifier->getCount(
189
            'users',
190
            'first_name',
191
            'Foo',
192
            1,
193
            'UserKey',
194
            ['last_name' => 'Bar']
195
        )->shouldHaveBeenCalled();
196
    }
197
198
    function it_replaces_fields_in_error_message_correctly()
199
    {