Source of file CKANRegistryPageControllerFunctionalTest.php
Size: 1,306 Bytes - Last Modified: 2021-12-23T10:28:15+00:00
/var/www/docs.ssmods.com/process/src/tests/php/Page/CKANRegistryPageControllerFunctionalTest.php
1234567891011121314151617181920212223242526272829303132333435363738394041 | <?php namespace SilverStripe\CKANRegistry\Tests\Page; use SilverStripe\CKANRegistry\Service\ResourcePopulatorInterface; use SilverStripe\Core\Injector\Injector; use SilverStripe\Dev\FunctionalTest; class CKANRegistryPageControllerFunctionalTest extends FunctionalTest { protected static $fixture_file = 'CKANRegistryPageControllerTest.yml'; protected static $use_draft_site = true; protected function setUp(): void { // Mock the field populator, in case an action we perform in a unit test tries to contact the mock API. // Done before parent::setUp() so write hooks don't run during fixture population. $populator = $this->createMock(ResourcePopulatorInterface::class); Injector::inst()->registerService($populator, ResourcePopulatorInterface::class); parent::setUp(); } public function testGetSchemaFromPageUrl() { $response = $this->get('animal-centers/schema'); $this->assertSame(200, $response->getStatusCode()); $this->assertJson($response->getBody()); } public function testGetSchemaFromPageSubUrl() { $response = $this->get('animal-centers/view/123/schema'); $this->assertSame(200, $response->getStatusCode()); $this->assertJson($response->getBody()); } } |