12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace Tests\tripal_ws\http;
- use StatonLab\TripalTestSuite\DBTransaction;
- use StatonLab\TripalTestSuite\TripalTestCase;
- class TripalContentTest extends TripalTestCase{
-
- use DBTransaction;
-
- public function testGettingMainContentList() {
-
- $response = $this->get('/web-services/content/v0.1');
-
- $response->assertSuccessful();
- $response->assertJsonStructure([
- '@context',
- '@id',
- '@type',
- 'label',
- 'totalItems',
- 'member' => [
- [
- '@id',
- '@type',
- 'label',
- 'description',
- ],
- ],
- ]);
- }
-
- public function testGettingListOfEntitiesInABundle() {
-
- $label = db_query('SELECT label FROM tripal_bundle LIMIT 1')->fetchField();
-
- $response = $this->get("/web-services/content/v0.1/$label");
-
- $response->assertSuccessful();
- $response->assertJsonStructure([
- '@context',
- '@id',
- '@type',
- 'label',
- 'totalItems',
- 'member',
- ]);
-
- $json = $response->json();
- $this->assertEquals($json['label'], "$label Collection");
- }
- public function testGettingAFeatureResource() {
-
- }
- }
|