Skip to content

Commit

Permalink
removed access premission check
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Dec 13, 2024
1 parent 576a339 commit 28c72b3
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions tests/src/Kernel/Form/StanfordMigrateCsvImportFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,6 @@ public function setup(): void {
$this->installSchema('file', ['file_usage']);
}

/**
* Migrations that aren't csv importers are denied access.
*/
public function testNonCsvAccess() {
$this->setMigrationRequest(Migration::load('stanford_migrate'));

$form_object = \Drupal::entityTypeManager()
->getFormObject('migration', 'csv-upload');
$account = $this->createMock(AccountInterface::class);
$this->assertFalse($form_object->access($account)->isAllowed());
}

/**
* CSV Importers have permission access.
*/
public function testCsvPermissionAccess() {
$this->setCsvMigrationRequest();

$account = $this->createMock(AccountInterface::class);
$form_object = \Drupal::entityTypeManager()
->getFormObject('migration', 'csv-upload');
$this->assertFalse($form_object->access($account)->isAllowed());

$account->method('hasPermission')->willReturn(TRUE);
$this->assertTrue($form_object->access($account)->isAllowed());
}

/**
* Test the functionality of the form.
*/
Expand Down

0 comments on commit 28c72b3

Please sign in to comment.