You are here

public function ParagraphsAccessTest::testCreateAccess in Paragraphs 8

@covers ::checkCreateAccess

@dataProvider createAccessTestCases

File

tests/src/Kernel/ParagraphsAccessTest.php, line 29

Class

ParagraphsAccessTest
@coversDefaultClass \Drupal\paragraphs\ParagraphAccessControlHandler @group paragraphs

Namespace

Drupal\Tests\paragraphs\Kernel

Code

public function testCreateAccess($request_format, $expected_result) {
  $request = new Request();
  $request
    ->setRequestFormat($request_format);
  $this->container
    ->get('request_stack')
    ->push($request);
  $result = $this->container
    ->get('entity_type.manager')
    ->getAccessControlHandler('paragraph')
    ->createAccess(NULL, NULL, [], TRUE);
  $this
    ->assertEquals($expected_result, $result);
}