Code Duplication    Length = 11-11 lines in 5 locations

tests/LightSaml/Tests/Action/Profile/Outbound/Message/AbstractResolveEndpointActionTest.php 5 locations

@@ 104-114 (lines=11) @@
101
     * @param CriteriaSet $criteriaSet
102
     * @param array       $bindings
103
     */
104
    protected function criteriaSetShouldHaveBindingCriteria(CriteriaSet $criteriaSet, array $bindings)
105
    {
106
        if (empty($bindings)) {
107
            $this->assertFalse($criteriaSet->has(BindingCriteria::class));
108
        } else {
109
            $this->assertTrue($criteriaSet->has(BindingCriteria::class));
110
            /** @var BindingCriteria $criteria */
111
            $criteria = $criteriaSet->getSingle(BindingCriteria::class);
112
            $this->assertEquals($bindings, $criteria->getAllBindings());
113
        }
114
    }
115
116
    /**
117
     * @param CriteriaSet $criteriaSet
@@ 120-130 (lines=11) @@
117
     * @param CriteriaSet $criteriaSet
118
     * @param string      $value
119
     */
120
    protected function criteriaSetShouldHaveDescriptorTypeCriteria(CriteriaSet $criteriaSet, $value)
121
    {
122
        if ($value) {
123
            $this->assertTrue($criteriaSet->has(DescriptorTypeCriteria::class));
124
            /** @var DescriptorTypeCriteria $criteria */
125
            $criteria = $criteriaSet->getSingle(DescriptorTypeCriteria::class);
126
            $this->assertEquals($value, $criteria->getDescriptorType());
127
        } else {
128
            $this->assertFalse($criteriaSet->has(DescriptorTypeCriteria::class));
129
        }
130
    }
131
132
    /**
133
     * @param CriteriaSet $criteriaSet
@@ 136-146 (lines=11) @@
133
     * @param CriteriaSet $criteriaSet
134
     * @param string      $value
135
     */
136
    protected function criteriaSetShouldHaveServiceTypeCriteria(CriteriaSet $criteriaSet, $value)
137
    {
138
        if ($value) {
139
            $this->assertTrue($criteriaSet->has(ServiceTypeCriteria::class));
140
            /** @var ServiceTypeCriteria $criteria */
141
            $criteria = $criteriaSet->getSingle(ServiceTypeCriteria::class);
142
            $this->assertEquals($value, $criteria->getServiceType());
143
        } else {
144
            $this->assertFalse($criteriaSet->has(ServiceTypeCriteria::class));
145
        }
146
    }
147
148
    /**
149
     * @param CriteriaSet $criteriaSet
@@ 152-162 (lines=11) @@
149
     * @param CriteriaSet $criteriaSet
150
     * @param string      $value
151
     */
152
    protected function criteriaSetShouldHaveIndexCriteria(CriteriaSet $criteriaSet, $value)
153
    {
154
        if ($value) {
155
            $this->assertTrue($criteriaSet->has(IndexCriteria::class));
156
            /** @var IndexCriteria $criteria */
157
            $criteria = $criteriaSet->getSingle(IndexCriteria::class);
158
            $this->assertEquals($value, $criteria->getIndex());
159
        } else {
160
            $this->assertFalse($criteriaSet->has(IndexCriteria::class));
161
        }
162
    }
163
164
    /**
165
     * @param CriteriaSet $criteriaSet
@@ 168-178 (lines=11) @@
165
     * @param CriteriaSet $criteriaSet
166
     * @param string      $value
167
     */
168
    protected function criteriaSetShouldHaveLocationCriteria(CriteriaSet $criteriaSet, $value)
169
    {
170
        if ($value) {
171
            $this->assertTrue($criteriaSet->has(LocationCriteria::class));
172
            /** @var LocationCriteria $criteria */
173
            $criteria = $criteriaSet->getSingle(LocationCriteria::class);
174
            $this->assertEquals($value, $criteria->getLocation());
175
        } else {
176
            $this->assertFalse($criteriaSet->has(LocationCriteria::class));
177
        }
178
    }
179
}
180