public function NodeOptionPremiumHelperTest::testHasFullAccessOnNonPremiumEntity in Node Option Premium 8
Tests full access on an entity that is not premium.
@covers ::hasFullAccess
File
- tests/
src/ Unit/ NodeOptionPremiumHelperTest.php, line 95
Class
- NodeOptionPremiumHelperTest
- @coversDefaultClass \Drupal\nopremium\NodeOptionPremiumHelper
Namespace
Drupal\Tests\nopremium\UnitCode
public function testHasFullAccessOnNonPremiumEntity() {
// Configure that the entity does have a premium field.
$this->entity
->hasField('premium')
->willReturn(TRUE);
// Configure the entity to be non-premium.
$entity = $this->entity
->reveal();
$entity->premium = new \stdClass();
$entity->premium->value = FALSE;
$this
->assertTrue($this->helper
->hasFullAccess($entity, $this->account
->reveal()));
}