use Wikimedia\StaticArrayWriter;
+/**
+ * @covers \Wikimedia\StaticArrayWriter
+ */
class StaticArrayWriterTest extends PHPUnit\Framework\TestCase {
public function testCreate() {
$data = [
'foo' => 'bar',
'baz' => 'rawr',
+ "they're" => '"quoted properly"',
+ 'nested' => [ 'elements', 'work' ],
+ 'and' => [ 'these' => 'do too' ],
];
$writer = new StaticArrayWriter();
$actual = $writer->create( $data, "Header\nWith\nNewlines" );
return [
'foo' => 'bar',
'baz' => 'rawr',
+ 'they\'re' => '"quoted properly"',
+ 'nested' => [
+ 0 => 'elements',
+ 1 => 'work',
+ ],
+ 'and' => [
+ 'these' => 'do too',
+ ],
];
PHP;