You are here

public function ServicesEndpointTests::testMissingPath in Services 6.3

Same name and namespace in other branches
  1. 7.3 tests/functional/ServicesEndpointTests.test \ServicesEndpointTests::testMissingPath()

Test missing path to endpoint causes an error.

File

tests/functional/ServicesEndpointTests.test, line 70

Class

ServicesEndpointTests
Run test cases for the endpoint with no authentication turned on.

Code

public function testMissingPath() {
  $edit = $this
    ->populateEndpointFAPI();
  unset($edit['path']);

  // Create and log in our privileged user.
  $this->privilegedUser = $this
    ->drupalCreateUser(array(
    'administer services',
    'administer nodes',
    'administer site configuration',
  ));
  $this
    ->drupalLogin($this->privilegedUser);
  $this
    ->drupalPost('admin/build/services/add', $edit, t('Save'));
  $this
    ->assertResponse('200', 'expected 200');
  $this
    ->assertText('Path to endpoint field is required.', t('Endpoint path missing error message.'));
  $this
    ->assertFieldByName('server', 'rest_server', t('Server is rest server'));
  $this
    ->assertFieldChecked('edit-services-use-content-permissions', t('Storage use content permission is checked.'));
}