@@ 152-158 (lines=7) @@ | ||
149 | /** |
|
150 | * @return $this |
|
151 | */ |
|
152 | public function countIsEqualToCountOf($countOrCountable, $expectedValueName = '') { |
|
153 | $stepName = $expectedValueName ? "has count equal to count of {$expectedValueName}" : "has count equal to count of expected"; |
|
154 | ||
155 | $this->startStep($stepName) |
|
156 | ->assertCount($this->convertToCount($countOrCountable)); |
|
157 | return $this; |
|
158 | } |
|
159 | ||
160 | /** |
|
161 | * @return $this |
|
@@ 163-169 (lines=7) @@ | ||
160 | /** |
|
161 | * @return $this |
|
162 | */ |
|
163 | public function countIsNotEqualToCountOf($countOrCountable, $expectedValueName = '') { |
|
164 | $stepName = $expectedValueName ? "does not have count equal count of {$expectedValueName}" : "does not have count equal count of expected"; |
|
165 | ||
166 | $this->startStep($stepName) |
|
167 | ->assertNotCount($this->convertToCount($countOrCountable)); |
|
168 | return $this; |
|
169 | } |
|
170 | ||
171 | protected function convertToCount($value) { |
|
172 | if (is_array($value) || $value instanceof \Countable || $value instanceof \Traversable) { |