Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for search api processor and D10 #33

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions tests/src/Kernel/EmbargoAccessQueryTaggingAlterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
class EmbargoAccessQueryTaggingAlterTest extends EmbargoKernelTestBase {
use DatabaseQueryTestTraits;

/**
* Embargo for test.
*
* @var \Drupal\embargo\EmbargoInterface
*/
protected EmbargoInterface $embargo;

/**
* {@inheritdoc}
*/
Expand Down Expand Up @@ -55,7 +62,7 @@ public function testNodeEmbargoReferencedMediaAccessQueryAlterAccessDenied() {
* Verifies that a user cannot view the files of an embargoed node.
*/
public function testNodeEmbargoReferencedFileAccessQueryAlterAccessDenied() {
$query = $this->generateFileSelectAccessQuery($this->user);
$query = $this->generateFileSelectAccessQuery($this->user, 'view');
$result = $query->execute()->fetchAll();
$this->assertCount(1, $result, 'File of embargoed nodes cannot be viewed');
}
Expand Down Expand Up @@ -102,8 +109,9 @@ public function testDeletedNodeEmbargoFileAccessQueryAlterAccessAllowed() {
$query = $this->generateFileSelectAccessQuery($this->user);

$result = $query->execute()->fetchAll();

$this->assertCount(2, $result,
'Files of non embargoed nodes can be viewed');
'Files of non embargoed nodes can be viewed');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/src/Kernel/EmbargoKernelTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Drupal\Tests\embargo\Kernel;

use Drupal\embargo\Entity\IpRange;
use Drupal\Core\Datetime\DrupalDateTime;
use Drupal\embargo\EmbargoInterface;
use Drupal\embargo\Entity\IpRange;
use Drupal\embargo\IpRangeInterface;
use Drupal\node\NodeInterface;
use Drupal\Tests\islandora_test_support\Kernel\AbstractIslandoraKernelTestBase;
Expand All @@ -26,7 +26,7 @@ abstract class EmbargoKernelTestBase extends AbstractIslandoraKernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = ['field', 'options', 'datetime'];
protected static $modules = ['field', 'options', 'datetime', 'search_api'];

/**
* Sets up the basic modules and schemas for testing embargoes.
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/IpRangeEmbargoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Drupal\Tests\embargo\Kernel;

use Drupal\node\NodeInterface;
use Drupal\embargo\EmbargoInterface;
use Drupal\embargo\IpRangeInterface;
use Drupal\node\NodeInterface;

/**
* Test IpRange embargo.
Expand Down
Loading