1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace Tests\tripal_ws\http;
- use StatonLab\TripalTestSuite\DBTransaction;
- use StatonLab\TripalTestSuite\TripalTestCase;
- class TripalWebServicesContentTest 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");
- }
- }
|