File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -189,11 +189,12 @@ public function count()
189
189
{
190
190
$ cnt = 0 ;
191
191
$ ord = 0 ;
192
- do {
192
+
193
+ while ($ ord !== $ this ->ordinalMax ) {
193
194
if ($ this ->getBit ($ ord ++)) {
194
195
++$ cnt ;
195
196
}
196
- } while ( $ ord !== $ this -> ordinalMax );
197
+ }
197
198
198
199
return $ cnt ;
199
200
}
Original file line number Diff line number Diff line change 3
3
namespace MabeEnumTest ;
4
4
5
5
use MabeEnum \EnumSet ;
6
+ use MabeEnumTest \TestAsset \EmptyEnum ;
6
7
use MabeEnumTest \TestAsset \EnumBasic ;
7
8
use MabeEnumTest \TestAsset \EnumInheritance ;
8
9
use MabeEnumTest \TestAsset \Enum32 ;
@@ -317,4 +318,10 @@ public function testFalseBitsetArgumentExceptionIfNotString()
317
318
$ enum = new EnumSet ('MabeEnumTest\TestAsset\Enum65 ' );
318
319
$ enum ->setBitset (0 );
319
320
}
321
+
322
+ public function testCountingEmptyEnumEmptySet ()
323
+ {
324
+ $ set = new EnumSet ('MabeEnumTest\TestAsset\EmptyEnum ' );
325
+ $ this ->assertSame (0 , $ set ->count ());
326
+ }
320
327
}
You can’t perform that action at this time.
0 commit comments