) {
return new NameTableStore(
$this->getMockLoadBalancer( $this->getCallCheckingDb( $insertCalls, $selectCalls ) ),
$this->getHashWANObjectCache( $cacheBag ),
new NullLogger(),
'slot_roles', 'role_id', 'role_name',
) {
return new NameTableStore(
$this->getMockLoadBalancer( $this->getCallCheckingDb( $insertCalls, $selectCalls ) ),
$this->getHashWANObjectCache( $cacheBag ),
new NullLogger(),
'slot_roles', 'role_id', 'role_name',
+ public function testGetAndAcquireIdInsertCallback() {
+ $store = $this->getNameTableSqlStore(
+ new EmptyBagOStuff(),
+ 1,
+ 1,
+ null,
+ function ( $insertFields ) {
+ $insertFields['role_id'] = 7251;
+ return $insertFields;
+ }
+ );
+ $this->assertSame( 7251, $store->acquireId( 'A' ) );
+ }
+