Mercurial > hg > isophonics-drupal-site
comparison core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php @ 16:c2387f117808
Routine composer update
author | Chris Cannam |
---|---|
date | Tue, 10 Jul 2018 15:07:59 +0100 |
parents | 1fec387a4317 |
children | af1871eacc83 |
comparison
equal
deleted
inserted
replaced
15:e200cb7efeb3 | 16:c2387f117808 |
---|---|
82 // Execute locale cron tasks to add tasks to the queue. | 82 // Execute locale cron tasks to add tasks to the queue. |
83 locale_cron(); | 83 locale_cron(); |
84 | 84 |
85 // Check whether tasks are added to the queue. | 85 // Check whether tasks are added to the queue. |
86 $queue = \Drupal::queue('locale_translation', TRUE); | 86 $queue = \Drupal::queue('locale_translation', TRUE); |
87 $this->assertEqual($queue->numberOfItems(), 3, 'Queue holds tasks for one project.'); | 87 $this->assertEqual($queue->numberOfItems(), 2, 'Queue holds tasks for one project.'); |
88 $item = $queue->claimItem(); | 88 $item = $queue->claimItem(); |
89 $queue->releaseItem($item); | 89 $queue->releaseItem($item); |
90 $this->assertEqual($item->data[1][0], 'contrib_module_two', 'Queue holds tasks for contrib module one.'); | 90 $this->assertEqual($item->data[1][0], 'contrib_module_two', 'Queue holds tasks for contrib module one.'); |
91 | 91 |
92 // Test: Run cron for a second time and check if tasks are not added to | 92 // Test: Run cron for a second time and check if tasks are not added to |
93 // the queue twice. | 93 // the queue twice. |
94 locale_cron(); | 94 locale_cron(); |
95 | 95 |
96 // Check whether no more tasks are added to the queue. | 96 // Check whether no more tasks are added to the queue. |
97 $queue = \Drupal::queue('locale_translation', TRUE); | 97 $queue = \Drupal::queue('locale_translation', TRUE); |
98 $this->assertEqual($queue->numberOfItems(), 3, 'Queue holds tasks for one project.'); | 98 $this->assertEqual($queue->numberOfItems(), 2, 'Queue holds tasks for one project.'); |
99 | 99 |
100 // Ensure last checked is updated to a greater time than the initial value. | 100 // Ensure last checked is updated to a greater time than the initial value. |
101 sleep(1); | 101 sleep(1); |
102 // Test: Execute cron and check if tasks are executed correctly. | 102 // Test: Execute cron and check if tasks are executed correctly. |
103 // Run cron to process the tasks in the queue. | 103 // Run cron to process the tasks in the queue. |