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([new Response(200, array('X-Mock' => 'abcpdq'), $this->getResponseBody())]); $client->getEmitter()->attach($mock); $this->sc->setClient($client); $this->sc->serviceDocument($this->references->getReference('journal')); }
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([new Response(400, array(), $this->getResponseBody())]); $client->getEmitter()->attach($mock); $this->sc->setClient($client); // do not call serviceDocument() here - it's going throw an exception. }
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->getReceiptResponse(), $this->getStatementResponse()]); $client->getEmitter()->attach($mock); $this->sc->setClient($client); $deposit = $this->references->getReference('deposit'); $deposit->setAuContainer($this->references->getReference('aucontainer')); $this->xml = $this->sc->statement($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. // } }