function ContentEntityExampleTest::providerTestPaths

Same name in other branches
  1. 3.x modules/content_entity_example/tests/src/Functional/ContentEntityExampleTest.php \Drupal\Tests\content_entity_example\Functional\ContentEntityExampleTest::providerTestPaths()
  2. 8.x-1.x content_entity_example/tests/src/Functional/ContentEntityExampleTest.php \Drupal\Tests\content_entity_example\Functional\ContentEntityExampleTest::providerTestPaths()

Data provider for testPaths.

Parameters

int $contact_id: The id of an existing Contact entity.

Return value

array Nested array of testing data. Arranged like this:

  • Expected response code.
  • Path to request.
  • Permission for the user.
1 call to ContentEntityExampleTest::providerTestPaths()
ContentEntityExampleTest::testPaths in modules/content_entity_example/tests/src/Functional/ContentEntityExampleTest.php
Test all paths exposed by the module, by permission.

File

modules/content_entity_example/tests/src/Functional/ContentEntityExampleTest.php, line 161

Class

ContentEntityExampleTest
Tests the basic functions of the Content Entity Example module.

Namespace

Drupal\Tests\content_entity_example\Functional

Code

protected function providerTestPaths($contact_id) {
    return [
        [
            200,
            '/content_entity_example_contact/' . $contact_id,
            'view contact entity',
        ],
        [
            403,
            '/content_entity_example_contact/' . $contact_id,
            '',
        ],
        [
            200,
            '/content_entity_example_contact/list',
            'view contact entity',
        ],
        [
            403,
            '/content_entity_example_contact/list',
            '',
        ],
        [
            200,
            '/content_entity_example_contact/add',
            'add contact entity',
        ],
        [
            403,
            '/content_entity_example_contact/add',
            '',
        ],
        [
            200,
            '/content_entity_example_contact/' . $contact_id . '/edit',
            'edit contact entity',
        ],
        [
            403,
            '/content_entity_example_contact/' . $contact_id . '/edit',
            '',
        ],
        [
            200,
            '/contact/' . $contact_id . '/delete',
            'delete contact entity',
        ],
        [
            403,
            '/contact/' . $contact_id . '/delete',
            '',
        ],
        [
            200,
            'admin/structure/content_entity_example_contact_settings',
            'administer contact entity',
        ],
        [
            403,
            'admin/structure/content_entity_example_contact_settings',
            '',
        ],
    ];
}