/**
  * @throws \LogicException
  * @throws \RuntimeException
  * @return string
  */
 public function getData()
 {
     if (null === $this->dataProvider) {
         throw new \LogicException('Please, set a data provider.');
     }
     $data = [];
     foreach ($this->dataProvider->getTables() as $table) {
         $data[$table->getName()] = ['columns' => $this->columnsExporter->getTableColumns($table), 'data_rows' => $this->dataRowsExporter->getDataRows($table)];
     }
     return json_encode($data);
 }
 public function test()
 {
     $dataColumn = $this->getMock(DataColumn::class, [], ['column_name']);
     $dataColumn->method('getName')->willReturn('column_name');
     $dataColumn->method('getValue')->willReturn('column_value');
     $dataRow = $this->getMock(DataRow::class);
     $dataRow->method('getDataColumns')->willReturn([$dataColumn]);
     $table = $this->getMock(Table::class, [], ['table_name']);
     $table->method('getDataRows')->willReturn([$dataRow]);
     $subject = new JsonTableDataRowsExporter();
     $result = $subject->getDataRows($table);
     static::assertTrue(is_array($result));
     static::assertCount(1, $result);
     $firstElement = reset($result);
     static::assertArrayHasKey('column_name', $firstElement);
     static::assertSame('column_value', $firstElement['column_name']);
 }