9 'class' =>
'PoolCounterMock',
16 ->setConstructorArgs( [ $poolCounterConfig,
'testCounter',
'someKey' ] )
19 ->setMethods( [
'idontexist' ] )
20 ->getMockForAbstractClass();
25 $poolCounterConfig = [
26 'class' =>
'PoolCounterMock',
34 ->setConstructorArgs( [ $poolCounterConfig,
'testCounter',
'key' ] )
35 ->setMethods( [
'idontexist' ] )
36 ->getMockForAbstractClass();
44 ->setMethods( [
'idontexist' ] )
45 ->disableOriginalConstructor()
46 ->getMockForAbstractClass();
48 $hashKeyIntoSlots =
new ReflectionMethod( $poolCounter,
'hashKeyIntoSlots' );
49 $hashKeyIntoSlots->setAccessible(
true );
51 $keysWithTwoSlots = $keysWithFiveSlots = [];
52 foreach ( range( 1, 100 )
as $i ) {
53 $keysWithTwoSlots[] = $hashKeyIntoSlots->invoke( $poolCounter,
'test',
'key ' . $i, 2 );
54 $keysWithFiveSlots[] = $hashKeyIntoSlots->invoke( $poolCounter,
'test',
'key ' . $i, 5 );
58 for ( $i = 0; $i <= 1; $i++ ) {
59 $twoSlotKeys[] =
"test:$i";
62 for ( $i = 0; $i <= 4; $i++ ) {
63 $fiveSlotKeys[] =
"test:$i";
71 $hashKeyIntoSlots->invoke( $poolCounter,
'test',
'asdfgh', 1000 ),
72 $hashKeyIntoSlots->invoke( $poolCounter,
'test',
'asdfgh', 1000 )
82 call_user_func_array(
'parent::__construct', func_get_args() );