#[Package('sales-channel')]
class StoreApiCustomFieldMapperTest extends TestCase
{ public function testMapping(): void
{ $connection =
$this->
createMock(Connection::
class);
$connection ->
method('fetchAllAssociative'
) ->
willReturn([['entity_name' => 'customer', 'name' => 'allowed'
]]);
$mapper =
new StoreApiCustomFieldMapper($connection);
static::
assertSame(['allowed' => 'yes'
],
$mapper->
map('customer',
new RequestDataBag(['bla' => 'foo', 'allowed' => 'yes'
])));
} public function testInternalStorageWorks(): void
{ $connection =
$this->
createMock(Connection::
class);
$connection ->
expects(static::
exactly(2
)) ->
method('fetchAllAssociative'
) ->
willReturn([]);