You are here

public function GeneralTest::testCronNotifyOptimize in OptimizeDB 8

Test notify optimize in optimizedb_cron() function.

File

tests/src/Functional/GeneralTest.php, line 79

Class

GeneralTest
Test the module functions.

Namespace

Drupal\Tests\optimizedb\Functional

Code

public function testCronNotifyOptimize() {
  $config = $this
    ->config('optimizedb.settings');
  $config
    ->set('optimization_period', 1)
    ->set('last_optimization', \Drupal::time()
    ->getRequestTime() - 3600 * 24 * 2)
    ->set('notify_optimize', FALSE)
    ->save();
  $this
    ->cronRun();
  $this
    ->assertTrue($this
    ->config('optimizedb.settings')
    ->get('notify_optimize'));
}