$gs->getSeries(); $t->fail('no code should be executed after throwing an exception'); } catch (Exception $e) { $t->pass('->getSeries() require series to be set.'); } // ->setSeries() $t->diag('->setSeries()'); $series = array(); $series[] = new ChartDataSerie(array('raw_data' => array(1, 2, 3))); $series[] = new ChartDataSerie(array('raw_data' => array(3, 4, 5))); $gs->setSeries($series); $t->cmp_ok($gs->getSeries(), '===', $series, '->getSeries() returns series set by setSeries()'); // ->getSeriesCount() $t->diag('->getSeriesCount()'); $gs = new ChartSource(); $t->cmp_ok($gs->getSeriesCount(), '===', null, '->getSeriesCount() returns a value only if raw_data parameter is set'); $series = array(); $series[] = new ChartDataSerie(array('raw_data' => array(1, 2, 3))); $series[] = new ChartDataSerie(array('raw_data' => array(3, 4, 5))); $gs->setSeries($series); $t->cmp_ok($gs->getSeriesCount(), '===', 2, '->getSeriesCount() counts the number of series in the raw_data array'); // ->getSeriesDataByColumn() $t->diag('->getSeriesDataByColumn()'); $data = Doctrine_Core::getTable('Charge')->findAll(); $gs = new ChartSource(); try { $gs->getSeriesDataByColumn('kilometers'); $t->fail('no code should be executed after throwing an exception'); } catch (Exception $e) { $t->pass('->getSeriesDataByColumn() Raw data must be set before retrieving series'); }