class MySQLKeyValueStorageTest extends TestCase
{ use IntegrationTestBehaviour;
private Connection
$connection;
private AbstractKeyValueStorage
$keyValueStorage;
protected function setUp(): void
{ $this->connection =
$this->
getContainer()->
get(Connection::
class);
$this->keyValueStorage =
new MySQLKeyValueStorage($this->connection
);
} public function testSet(): void
{ $this->keyValueStorage->
set('key-1', 'value-1'
);
$this->keyValueStorage->
set('key-2', null
);
$this->keyValueStorage->
set('key-3',
['a' => 'b'
]);
$value =
$this->connection->
fetchAllKeyValue('SELECT `key`, `value` FROM `app_config` WHERE `key` IN (:keys) ORDER BY `key` ASC',
[ 'keys' =>
['key-1', 'key-2', 'key-3'
],
],
[