You are here

public function ServicesEndpointTests::testSuccessfulAddEndpoint in Services 6.3

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

Test adding an endpoint succeeds.

File

tests/functional/ServicesEndpointTests.test, line 49

Class

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

Code

public function testSuccessfulAddEndpoint() {
  $edit = $this
    ->populateEndpointFAPI();

  // 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', t('expected 200'));
  $this
    ->drupalGet('admin/build/services/list');
  $this
    ->assertResponse('200', t('expected 200'));
  $this
    ->assertText($edit['name'], t('Endpoint path appears'));
  $this
    ->assertText('Normal', t('Storage is in database'));
}