Files
librenms-librenms/tests/unit/Adapter/HelpersTest.php
T
Walter Dal Mut 932cd992ff Optimized list to string conversion
The inline protocol converts key values to strings
2015-06-25 23:33:32 +02:00

24 lines
643 B
PHP

<?php
namespace InfluxDB\Adapter;
class HelpersTest extends \PHPUnit_Framework_TestCase
{
/**
* @dataProvider getElements
*/
public function testListToInlineValues($message, $result, $escape)
{
$this->assertEquals($result, list_to_string($message, $escape));
}
public function getElements()
{
return [
[["one" => "two"], "one=two", false],
[["one" => "two"], "one=\"two\"", true],
[["one" => "two", "three" => "four"], "one=two,three=four", false],
[["one" => "two", "three" => "four"], "one=\"two\",three=\"four\"", true],
];
}
}