setConnection('studip', $this->getModule('\\Helper\\StudipDb')->dbh); } protected function _after() { } // tests public function testGetInstitutesShow() { $allInstitutes = \Institute::findAll(); $this->tester->assertTrue(0 < count($allInstitutes)); $institute = current($allInstitutes); $app = $this->tester->createApp(null, 'get', '/institutes/{id}', InstitutesShow::class); $requestBuilder = $this->tester->createRequestBuilder(null); $requestBuilder->setUri('/institutes/' . $institute->id)->fetch(); $response = $this->tester->sendMockRequest($app, $requestBuilder->getRequest()); $this->tester->assertTrue($response->isSuccessfulDocument()); $document = $response->document(); $this->tester->assertTrue($document->isSingleResourceDocument()); $this->tester->assertSame($institute->id, $document->primaryResource()->id()); } }