Files
piratepoet/tests/unit/Config/HooksTest.php
Vlad 714f81d936 - Moves hooks setup to wp_load action
- Adds post notification scheduler to all post types
2017-01-08 17:27:02 -05:00

21 lines
653 B
PHP

<?php
class HooksTest extends MailPoetTest {
function testItHooksSchedulerToMultiplePostTypes() {
global $wp_filter;
$post_types = get_post_types();
$hook_count = 0;
foreach($post_types as $post_type) {
expect(!empty($wp_filter['publish_' . $post_type]))->true();
$filter = $wp_filter['publish_' . $post_type];
$is_hooked = false;
foreach($filter->callbacks[10] as $name => $hook) {
if(!preg_match('/schedulePostNotification/', $name)) continue;
$is_hooked = true;
$hook_count++;
}
expect($is_hooked)->true();
}
expect($hook_count)->equals(count($post_types));
}
}