public function testAddListaPartecipanti() { $this->objectWrapper->setOperatoriAggiudicatariGetterWrapper(new OperatoriAggiudicatariGetterWrapper(new OperatoriAggiudicatariGetter($this->getEntityManagerMock()))); $this->objectWrapper->setEntityManager($this->getEntityManagerMock()); $records = $this->objectWrapper->addListaPartecipanti(array(array('id' => 1, 'beneficiario' => 'Beneficiario 1'), array('id' => 2, 'beneficiario' => 'Beneficiario 2'))); $this->assertArrayHasKey('operatori', $records[0]); }
/** * @param array $input * @return array */ public function getResourceRecords(array $input) { $wrapper = new ContrattiPubbliciGetterWrapper(new ContrattiPubbliciGetter($this->getEntityManager())); $wrapper->setInput($input); $wrapper->setupQueryBuilder(); $wrapper->setupPaginator($wrapper->setupQuery($this->getEntityManager())); $wrapper->setupPaginatorCurrentPage($this->getPage()); $wrapper->setupPaginatorItemsPerPage($this->getPerPage()); $paginator = $wrapper->getPaginator(); $arrayToReturn = array(); $arrayToReturn['metadata'] = array('titolo' => 'Pubblicazione legge 190 anno 1', 'abstract' => 'Pubblicazione legge 190 anno 1 rif.', 'dataPubbicazioneDataset' => '2015-03-04', 'entePubblicatore' => 'Comune di Telti', 'dataUltimoAggiornamentoDataset' => '2015-03-04', 'annoRiferimento' => '2015', 'urlFile' => 'http://www.comune.telti.ot.it/xml/dataset.xml', 'licenza' => 'IODL'); foreach ($paginator as $row) { $arrayToReturn[] = $row; } return $arrayToReturn; }