Skip to content

Commit

Permalink
[API] add Incomplete tests markers - correct travis errors
Browse files Browse the repository at this point in the history
  • Loading branch information
spell00 committed Jul 9, 2020
1 parent 114a026 commit 5ec04bc
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 45 deletions.
29 changes: 18 additions & 11 deletions modules/api/test/LorisApiDicomsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ public function testPostCandidatesCandidVisitDicoms(): void
]
);
if ($response->getStatusCode() === 405) {
$this->markTestIncomplete("The method POST is not available for the" .
"endpoint candidates/$this->candidTest/$this->visitTest/dicoms");
$this->markTestIncomplete(
"The method POST is not available for the" .
"endpoint candidates/$this->candidTest/$this->visitTest/dicoms"
);
}
// Verify the status code - TODO METHOD NOT ALLOWED YET
$this->assertEquals(200, $response->getStatusCode());
Expand All @@ -262,10 +264,11 @@ public function testGetCandidatesCandidVisitDicomsTarname(): void
[
'headers' => $this->headers,
'http_errors' => false
]
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: " .
$this->markTestIncomplete(
"Endpoint not found: " .
"candidates/$this->candidTest/$this->visitTest/dicoms "
);
}
Expand All @@ -274,16 +277,16 @@ public function testGetCandidatesCandidVisitDicomsTarname(): void
$body = $response->getBody();
$this->assertNotEmpty($body);

$resource = fopen($this->tarfileTest, 'w');
$stream = GuzzleHttp\Psr7\stream_for($resource);
$resource = fopen($this->tarfileTest, 'w');
$stream = GuzzleHttp\Psr7\stream_for($resource);
$response_stream = $this->client->request(
'GET',
"candidates/$this->candidTest/$this->visitTest/dicoms/" .
"$this->tarfileTest",
[
'http_errors' => false,
'headers' => $this->headers,
'save_to' => $stream,
'headers' => $this->headers,
'save_to' => $stream,
]
);
$this->assertEquals(200, $response_stream->getStatusCode());
Expand All @@ -294,7 +297,8 @@ public function testGetCandidatesCandidVisitDicomsTarname(): void
$this->assertFileIsReadable($this->tarfileTest);
}

// THESE ENDPOINTS DO NOT EXIST YET, this is why the tests assert the response is 404
// THESE ENDPOINTS DO NOT EXIST YET, this is why the tests assert
// the response is 404

/**
* Tests the HTTP GET request for the
Expand All @@ -314,7 +318,8 @@ public function testGetCandidatesCandidVisitDicomsTarnameProcesses(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: " .
$this->markTestIncomplete(
"Endpoint not found: " .
"candidates/$this->candidTest/$this->visitTest/dicoms "
);
}
Expand Down Expand Up @@ -344,9 +349,11 @@ public function testGetCandidatesCandidVisitDicomsTarnameProcessesProcessid():
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: " .
$this->markTestIncomplete(
"Endpoint not found: " .
"candidates/$this->candidTest/$this->visitTest/dicoms "
);
}
$this->assertEquals(200, $response->getStatusCode());
// Verify the endpoint has a body
$body = $response->getBody();
Expand Down
29 changes: 18 additions & 11 deletions modules/api/test/LorisApiImagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ public function testGetCandidatesCandidVisitImagesFilename(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: " .
$this->markTestIncomplete(
"Endpoint not found: " .
"candidates/$this->candidTest/$this->visitTest/images/" .
"$this->imagefileTest"
);
Expand All @@ -134,7 +135,7 @@ public function testGetCandidatesCandidVisitImagesFilename(): void
"candidates/$this->candidTest/$this->visitTest/images/" .
"$this->imagefileTest",
[
'headers' => $this->headers,
'headers' => $this->headers,
'http_errors' => false,
]
);
Expand Down Expand Up @@ -347,7 +348,8 @@ public function testGetCandidatesCandidVisitImagesFilenameFormatBbrowser(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: " .
$this->markTestIncomplete(
"Endpoint not found: " .
"candidates/$this->candidTest/$this->visitTest/images/" .
"$this->imagefileTest/format/brainbrowser"
);
Expand Down Expand Up @@ -441,7 +443,8 @@ public function testGetCandidatesCandidVisitImagesFilenameFormatRaw(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: " .
$this->markTestIncomplete(
"Endpoint not found: " .
"candidates/$this->candidTest/$this->visitTest/images/" .
"$this->imagefileTest/format/raw"
);
Expand Down Expand Up @@ -472,13 +475,14 @@ public function testGetCandidatesCandidVisitImagesFilenameFormatThumbnail():
"candidates/$this->candidTest/$this->visitTest/images/" .
"$this->imagefileTest/format/thumbnail",
[
'headers' => $this->headers,
'headers' => $this->headers,
'http_errors' => false,
'save_to' => $stream
'save_to' => $stream
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: " .
if ($response_stream->getStatusCode() === 404) {
$this->markTestIncomplete(
"Endpoint not found: " .
"candidates/$this->candidTest/$this->visitTest/images/" .
"$this->imagefileTest/format/thumbnail"
);
Expand Down Expand Up @@ -509,7 +513,8 @@ public function testGetCandidatesCandidVisitImagesFilenameHeaders(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: " .
$this->markTestIncomplete(
"Endpoint not found: " .
"candidates/$this->candidTest/$this->visitTest/images/" .
"$this->imagefileTest/headers"
);
Expand Down Expand Up @@ -752,7 +757,8 @@ public function testGetCandidatesCandidVisitImagesFilenameHeadersFull(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: " .
$this->markTestIncomplete(
"Endpoint not found: " .
"candidates/$this->candidTest/$this->visitTest/images/" .
"$this->imagefileTest/headers/full"
);
Expand Down Expand Up @@ -839,7 +845,8 @@ public function testGetCandidatesCandidVisitImagesFilenameHeadersHeadername():
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: " .
$this->markTestIncomplete(
"Endpoint not found: " .
"candidates/$this->candidTest/$this->visitTest/images/" .
"$this->imagefileTest/headers/headername"
);
Expand Down
42 changes: 28 additions & 14 deletions modules/api/test/LorisApiInstrumentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public function testGetCandidatesCandidVisitInstruments(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: " .
$this->markTestIncomplete(
"Endpoint not found: " .
"candidates/$this->candidTest/$this->visitTest/instruments"
);
}
Expand Down Expand Up @@ -161,7 +162,8 @@ public function testGetCandidatesCandidVisitInstrumentsInstrument(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: " .
$this->markTestIncomplete(
"Endpoint not found: " .
"candidates/$this->candidTest/$this->visitTest/instruments/" .
"$this->instrumentTest"
);
Expand Down Expand Up @@ -291,7 +293,8 @@ public function testPatchCandidatesCandidVisitInstrumentsInstrument(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: PATCH" .
$this->markTestIncomplete(
"Endpoint not found: PATCH" .
"candidates/$candid/$visit/instruments/$instrument"
);
}
Expand Down Expand Up @@ -333,7 +336,8 @@ public function testPutCandidatesCandidVisitInstrumentsInstrument(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: PUT" .
$this->markTestIncomplete(
"Endpoint not found: PUT" .
"candidates/$candid/$visit/instruments/$instrument"
);
}
Expand Down Expand Up @@ -361,7 +365,8 @@ public function testGetCandidatesCandidVisitInstrumentsInstrumentFlags(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: GET" .
$this->markTestIncomplete(
"Endpoint not found: GET" .
"candidates/$this->candidTest/$this->visitTest/instruments/" .
"$this->instrumentTest/flags"
);
Expand Down Expand Up @@ -469,7 +474,8 @@ public function testPatchCandidatesCandidVisitInstrumentsInstrumentFlags(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: PATCH" .
$this->markTestIncomplete(
"Endpoint not found: PATCH" .
"candidates/$candid/$visit/instruments/$instrument/flags"
);
}
Expand Down Expand Up @@ -511,7 +517,8 @@ public function testPutCandidatesCandidVisitInstrumentsInstrumentFlags(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: PUT" .
$this->markTestIncomplete(
"Endpoint not found: PUT" .
"candidates/$candid/$visit/instruments/$instrument/flags"
);
}
Expand Down Expand Up @@ -539,8 +546,10 @@ public function testGetCandidatesCandidVisitInstrumentsInstrumentDde(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: GET" .
"candidates/$candid/$visit/instruments/$instrument/dde"
$this->markTestIncomplete(
"Endpoint not found: GET" .
"candidates/$this->candidTest/$this->visitTest/instruments/" .
"$this->instrumentTest/dde"
);
}
$this->assertEquals(200, $response->getStatusCode());
Expand Down Expand Up @@ -663,7 +672,8 @@ public function testPatchCandidatesCandidVisitInstrumentsInstrumentDde(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: PATCH" .
$this->markTestIncomplete(
"Endpoint not found: PATCH" .
"candidates/$candid/$visit/instruments/$instrument/dde"
);
}
Expand Down Expand Up @@ -705,7 +715,8 @@ public function testPutCandidatesCandidVisitInstrumentsInstrumentDde(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: PUT" .
$this->markTestIncomplete(
"Endpoint not found: PUT" .
"candidates/$candid/$visit/instruments/$instrument/dde"
);
}
Expand Down Expand Up @@ -735,7 +746,8 @@ public function testGetCandidatesCandidVisitInstrumentsInstrumentDdeFlags():
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: GET" .
$this->markTestIncomplete(
"Endpoint not found: GET" .
"candidates/$this->candidTest/$this->visitTest/instruments/
$this->instrumentTest/dde/flags"
);
Expand Down Expand Up @@ -843,7 +855,8 @@ public function testPatchCandidVisitInstrumentsInstrumentDdeFlags(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: GET" .
$this->markTestIncomplete(
"Endpoint not found: GET" .
"candidates/$candid/$visit/instruments/$instrument/dde/flags",
);
}
Expand Down Expand Up @@ -885,7 +898,8 @@ public function testPutCandidVisitInstrumentsInstrumentDdeFlags(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: GET" .
$this->markTestIncomplete(
"Endpoint not found: GET" .
"candidates/$candid/$visit/instruments/$instrument/dde/flags",
);
}
Expand Down
3 changes: 2 additions & 1 deletion modules/api/test/LorisApiProjectsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,8 @@ public function testGetProjectsProjectInstrumentsInstrument(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: GET" .
$this->markTestIncomplete(
"Endpoint not found: GET" .
"projects/$this->projectIdTest/instruments/aosi",
);
}
Expand Down
24 changes: 16 additions & 8 deletions modules/api/test/LorisApiRecordingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public function testGetCandidatesCandidVisitRecordings(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: GET" .
$this->markTestIncomplete(
"Endpoint not found: GET" .
"candidates/$this->candidTest/$this->visitTest/recordings/"
);
}
Expand Down Expand Up @@ -133,7 +134,8 @@ public function testGetCandidatesCandidVisitRecordingsEdffile(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: GET" .
$this->markTestIncomplete(
"Endpoint not found: GET" .
"candidates/$this->candidTest/$this->visitTest/recordings/" .
"$this->frecordTest"
);
Expand Down Expand Up @@ -164,7 +166,8 @@ public function testGetCandidatesCandidVisitRecordingsEdffileChannels(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: GET" .
$this->markTestIncomplete(
"Endpoint not found: GET" .
"candidates/$this->candidTest/$this->visitTest/recordings/" .
"$this->frecordTest/channels"
);
Expand Down Expand Up @@ -353,7 +356,8 @@ public function testGetCandidatesCandidVisitRecordingsEdffileChannelsMeta():
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: GET" .
$this->markTestIncomplete(
"Endpoint not found: GET" .
"candidates/$this->candidTest/$this->visitTest/recordings/" .
"$this->frecordTest/channels/meta"
);
Expand Down Expand Up @@ -541,7 +545,8 @@ public function testGetCandidatesCandidVisitRecordingsEdfFileElectrodes(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: GET" .
$this->markTestIncomplete(
"Endpoint not found: GET" .
"candidates/$this->candidTest/$this->visitTest/recordings/" .
"$this->frecordTest/electrodes"
);
Expand Down Expand Up @@ -688,7 +693,8 @@ public function testGetCandidatesCandidVisitRecordingsEdfFileElectrodesMeta():
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: GET" .
$this->markTestIncomplete(
"Endpoint not found: GET" .
"candidates/$this->candidTest/$this->visitTest/recordings/" .
"$this->frecordTest/electrodes/meta"
);
Expand Down Expand Up @@ -834,7 +840,8 @@ public function testGetCandidatesCandidVisitRecordingsEdfFileEvents(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: GET" .
$this->markTestIncomplete(
"Endpoint not found: GET" .
"candidates/$this->candidTest/$this->visitTest/recordings/" .
"$this->frecordTest/events/meta"
);
Expand Down Expand Up @@ -980,7 +987,8 @@ public function testGetCandidatesCandidVisitRecordingsEdfFileEventsMeta(): void
]
);
if ($response->getStatusCode() === 404) {
$this->markTestIncomplete("Endpoint not found: GET" .
$this->markTestIncomplete(
"Endpoint not found: GET" .
"candidates/$this->candidTest/$this->visitTest/recordings/" .
"$this->frecordTest/events/meta"
);
Expand Down

0 comments on commit 5ec04bc

Please sign in to comment.