public function testFromRow() { $row = array('id' => '1', 'created' => $this->date->format('Y-m-d H:i:s'), 'username' => 'test1', 'charttype' => 'StorageUsagePerMonth', 'chartprovider' => 'c3js', 'metadata' => 'metadata'); $config = ChartConfig::fromRow($row); $this->assertInstanceOf('OCA\\ocUsageCharts\\Entity\\ChartConfig', $config); $this->assertEquals('1', $config->getId()); $this->assertEquals($this->date, $config->getDate()); $this->assertEquals('test1', $config->getUsername()); $this->assertEquals('c3js', $config->getChartProvider()); $this->assertEquals('metadata', $config->getMetaData()); $this->assertEquals('StorageUsagePerMonth', $config->getChartType()); }