Révision 4444412d
Ajouté par Julien Enselme il y a environ 10 ans
drupal7/modules/system/system.test | ||
---|---|---|
867 | 867 |
} |
868 | 868 |
} |
869 | 869 |
|
870 |
/** |
|
871 |
* Test execution of the cron queue. |
|
872 |
*/ |
|
873 |
class CronQueueTestCase extends DrupalWebTestCase { |
|
874 |
/** |
|
875 |
* Implement getInfo(). |
|
876 |
*/ |
|
877 |
public static function getInfo() { |
|
878 |
return array( |
|
879 |
'name' => 'Cron queue functionality', |
|
880 |
'description' => 'Tests the cron queue runner.', |
|
881 |
'group' => 'System' |
|
882 |
); |
|
883 |
} |
|
884 |
|
|
885 |
function setUp() { |
|
886 |
parent::setUp(array('common_test', 'common_test_cron_helper')); |
|
887 |
} |
|
888 |
|
|
889 |
/** |
|
890 |
* Tests that exceptions thrown by workers are handled properly. |
|
891 |
*/ |
|
892 |
function testExceptions() { |
|
893 |
$queue = DrupalQueue::get('cron_queue_test_exception'); |
|
894 |
|
|
895 |
// Enqueue an item for processing. |
|
896 |
$queue->createItem(array($this->randomName() => $this->randomName())); |
|
897 |
|
|
898 |
// Run cron; the worker for this queue should throw an exception and handle |
|
899 |
// it. |
|
900 |
$this->cronRun(); |
|
901 |
|
|
902 |
// The item should be left in the queue. |
|
903 |
$this->assertEqual($queue->numberOfItems(), 1, 'Failing item still in the queue after throwing an exception.'); |
|
904 |
} |
|
905 |
|
|
906 |
} |
|
907 |
|
|
870 | 908 |
class AdminMetaTagTestCase extends DrupalWebTestCase { |
871 | 909 |
/** |
872 | 910 |
* Implement getInfo(). |
Formats disponibles : Unified diff
Update drupal 7.27 -> 7.28