8 call_user_func_array(
'parent::__construct', func_get_args() );
17 $poolCounterConfig = [
18 'class' =>
'PoolCounterMock',
25 ->setConstructorArgs( [ $poolCounterConfig,
'testCounter',
'someKey' ] )
28 ->setMethods( [
'idontexist' ] )
29 ->getMockForAbstractClass();
34 $poolCounterConfig = [
35 'class' =>
'PoolCounterMock',
43 ->setConstructorArgs( [ $poolCounterConfig,
'testCounter',
'key' ] )
44 ->setMethods( [
'idontexist' ] )
45 ->getMockForAbstractClass();
53 ->setMethods( [
'idontexist' ] )
54 ->disableOriginalConstructor()
55 ->getMockForAbstractClass();
57 $hashKeyIntoSlots =
new ReflectionMethod( $poolCounter,
'hashKeyIntoSlots' );
58 $hashKeyIntoSlots->setAccessible(
true );
60 $keysWithTwoSlots = $keysWithFiveSlots = [];
61 foreach ( range( 1, 100 )
as $i ) {
62 $keysWithTwoSlots[] = $hashKeyIntoSlots->invoke( $poolCounter,
'test',
'key ' . $i, 2 );
63 $keysWithFiveSlots[] = $hashKeyIntoSlots->invoke( $poolCounter,
'test',
'key ' . $i, 5 );
67 for ( $i = 0; $i <= 1; $i++ ) {
68 $twoSlotKeys[] =
"test:$i";
71 for ( $i = 0; $i <= 4; $i++ ) {
72 $fiveSlotKeys[] =
"test:$i";
80 $hashKeyIntoSlots->invoke( $poolCounter,
'test',
'asdfgh', 1000 ),
81 $hashKeyIntoSlots->invoke( $poolCounter,
'test',
'asdfgh', 1000 )