Code Duplication    Length = 21-21 lines in 6 locations

Tests/Units/ArrayCollection/ArrayHashMapTests.php 1 location

@@ 130-150 (lines=21) @@
127
    /*
128
     * Test sort.
129
     */
130
    public function testSort()
131
    {
132
        $this
133
            ->given(
134
                $comparator = $this->comparator(),
135
                $reverseComparator = $comparator->reverse(),
136
                $collection = $this->randomCollection()
137
            )
138
            ->when($collection->sort())
139
            ->then()
140
                ->hashmap($collection)
141
                    ->isSortedUsing($comparator)
142
            ->and
143
            ->when($collection->sort($reverseComparator))
144
            ->then()
145
                ->hashmap($collection)
146
                    ->isSortedUsing($reverseComparator)
147
                ->hashmap($collection)
148
                    ->isNotSortedUsing($comparator)
149
        ;
150
    }
151
152
    /*
153
     * Test offsetUnset.

Tests/Units/ArrayCollection/ArrayListTests.php 1 location

@@ 122-142 (lines=21) @@
119
    /*
120
     * Test sort.
121
     */
122
    public function testSort()
123
    {
124
        $this
125
            ->given(
126
                $comparator = $this->comparator(),
127
                $reverseComparator = $comparator->reverse(),
128
                $collection = $this->randomCollection()
129
            )
130
            ->when($collection->sort())
131
            ->then()
132
                ->list($collection)
133
                    ->isSortedUsing($comparator)
134
            ->and
135
            ->when($collection->sort($reverseComparator))
136
            ->then()
137
                ->list($collection)
138
                    ->isSortedUsing($reverseComparator)
139
                ->list($collection)
140
                    ->isNotSortedUsing($comparator)
141
        ;
142
    }
143
144
    /*
145
     * Test validateKey.

Tests/Units/ArrayCollection/ArraySetTests.php 1 location

@@ 115-135 (lines=21) @@
112
    /*
113
     * Test sort.
114
     */
115
    public function testSort()
116
    {
117
        $this
118
            ->given(
119
                $comparator = $this->comparator(),
120
                $reverseComparator = $comparator->reverse(),
121
                $collection = $this->randomCollection()
122
            )
123
            ->when($collection->sort())
124
            ->then()
125
                ->set($collection)
126
                    ->isSortedUsing($comparator)
127
            ->and
128
            ->when($collection->sort($reverseComparator))
129
            ->then()
130
                ->set($collection)
131
                    ->isSortedUsing($reverseComparator)
132
                ->set($collection)
133
                    ->isNotSortedUsing($comparator)
134
        ;
135
    }
136
137
    /*
138
     * Test offsetExists.

Tests/Units/ArrayCollection/SortedArrayHashMapTests.php 1 location

@@ 103-123 (lines=21) @@
100
    /*
101
     * Test sort.
102
     */
103
    public function testSort()
104
    {
105
        $this
106
            ->given(
107
                $comparator = $this->comparator(),
108
                $reverseComparator = $comparator->reverse(),
109
                $collection = $this->randomCollection()
110
            )
111
            ->when($collection->sort($reverseComparator))
112
            ->then()
113
                ->hashmap($collection)
114
                    ->isSortedUsing($reverseComparator)
115
            ->and
116
            ->when($collection->sort())
117
            ->then()
118
                ->hashmap($collection)
119
                    ->isSortedUsing($reverseComparator)
120
                ->hashmap($collection)
121
                    ->isNotSortedUsing($comparator)
122
        ;
123
    }
124
}
125

Tests/Units/ArrayCollection/SortedArrayListTests.php 1 location

@@ 176-196 (lines=21) @@
173
    /*
174
     * Test sort.
175
     */
176
    public function testSort()
177
    {
178
        $this
179
            ->given(
180
                $comparator = $this->comparator(),
181
                $reverseComparator = $comparator->reverse(),
182
                $collection = $this->randomCollection()
183
            )
184
            ->when($collection->sort($reverseComparator))
185
            ->then()
186
                ->list($collection)
187
                    ->isSortedUsing($reverseComparator)
188
            ->and
189
            ->when($collection->sort())
190
            ->then()
191
                ->list($collection)
192
                    ->isSortedUsing($reverseComparator)
193
                ->list($collection)
194
                    ->isNotSortedUsing($comparator)
195
        ;
196
    }
197
}
198

Tests/Units/ArrayCollection/SortedArraySetTests.php 1 location

@@ 130-150 (lines=21) @@
127
    /*
128
     * Test sort.
129
     */
130
    public function testSort()
131
    {
132
        $this
133
            ->given(
134
                $comparator = $this->comparator(),
135
                $reverseComparator = $comparator->reverse(),
136
                $collection = $this->randomCollection()
137
            )
138
            ->when($collection->sort($reverseComparator))
139
            ->then()
140
                ->set($collection)
141
                    ->isSortedUsing($reverseComparator)
142
            ->and
143
            ->when($collection->sort())
144
            ->then()
145
                ->set($collection)
146
                    ->isSortedUsing($reverseComparator)
147
                ->set($collection)
148
                    ->isNotSortedUsing($comparator)
149
        ;
150
    }
151
}
152