[ 'name' => 'skin-vector-toc-experiment', 'enabled' => $abValue, 'buckets' => [ 'unsampled' => [ 'samplingRate' => 0, ], 'control' => [ 'samplingRate' => 0.5, ], 'treatment' => [ 'samplingRate' => 0.5, ] ] ], ] ); $user = $this->createMock( User::class ); $user->method( 'isRegistered' )->willReturn( $userId !== 0 ); $user->method( 'getID' )->willReturn( $userId ); $centralIdLookup = $this->createMock( CentralIdLookup::class ); $centralIdLookup->method( 'centralIdFromLocalUser' )->willReturn( $userId ); $requirement = new TableOfContentsTreatmentRequirement( $config, $user, $useCentralIdLookup ? $centralIdLookup : null ); $this->assertSame( $expected, $requirement->isMet(), $msg ); } }