You are here

public function AgreementTest::testGetAgreementFrequencyTimestamp in Agreement 8.2

Same name and namespace in other branches
  1. 3.0.x tests/src/Unit/Entity/AgreementTest.php \Drupal\Tests\agreement\Unit\Entity\AgreementTest::testGetAgreementFrequencyTimestamp()

Asserts the frequency timestamp based on reset_date and frequency.

@dataProvider frequencyTimestampProvider

Parameters

int $lessThan: The expected value to be equal to or less than. This is not the exact value because it changes by the second.

array|null $settings: The settings to use.

File

tests/src/Unit/Entity/AgreementTest.php, line 71

Class

AgreementTest
Tests methods on the agreement entity.

Namespace

Drupal\Tests\agreement\Unit\Entity

Code

public function testGetAgreementFrequencyTimestamp($lessThan, $settings) {
  $agreement = new Agreement([
    'id' => 'test',
    'label' => 'Test',
    'path' => '/agreement',
    'agreement' => 'Agree',
    'settings' => $settings,
  ], 'agreement');
  $this
    ->assertLessThanOrEqual($lessThan, $agreement
    ->getAgreementFrequencyTimestamp());
}