public function setUp() { parent::setUp(); $this->sc = $this->getContainer()->get('swordclient'); $client = new Client(); $this->history = new History(); $client->getEmitter()->attach($this->history); $mock = new Mock([$this->getServiceDocumentResponse(), $this->getCreateDepositResponse()]); $client->getEmitter()->attach($mock); $this->sc->setClient($client); $deposit = $this->references->getReference('deposit'); $deposit->setAuContainer($this->references->getReference('aucontainer')); $this->sc->createDeposit($deposit); }
public function setUp() { parent::setUp(); $this->sc = $this->getContainer()->get('swordclient'); $client = new Client(); $this->history = new History(); $client->getEmitter()->attach($this->history); $mock = new Mock([$this->getServiceDocumentResponse(), $this->getCreateDepositResponse()]); $client->getEmitter()->attach($mock); $this->sc->setClient($client); $deposit = $this->references->getReference('deposit'); $deposit->setAuContainer($this->references->getReference('aucontainer')); // try { $this->sc->createDeposit($deposit); // } catch (Exception $e) { // // expected, because the response XML isn't valid. // } }
/** * Process one deposit. Fetch the data and write it to the file system. * Updates the deposit status. * * @param Deposit $deposit * * @return type */ protected function processDeposit(Deposit $deposit) { $this->logger->notice("Sending deposit {$deposit->getDepositUuid()}"); return $this->client->createDeposit($deposit); }