本文整理匯總了PHP中WP_Mock::assertHooksAdded方法的典型用法代碼示例。如果您正苦於以下問題:PHP WP_Mock::assertHooksAdded方法的具體用法?PHP WP_Mock::assertHooksAdded怎麽用?PHP WP_Mock::assertHooksAdded使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WP_Mock
的用法示例。
在下文中一共展示了WP_Mock::assertHooksAdded方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: test_init_non_admin
public function test_init_non_admin()
{
\WP_Mock::wpFunction('is_admin', array('return' => true));
$plugin = new SpiderBlocker();
\WP_Mock::expectActionAdded('generate_rewrite_rules', array($plugin, 'generateRewriteRules'));
$plugin->__construct();
\WP_Mock::assertHooksAdded();
}
示例2: testInit
public function testInit()
{
$plugin = new PassiveIndexationCheck();
\WP_Mock::expectActionAdded('do_robots', array($plugin, 'checkBotVisit'));
\WP_Mock::expectActionAdded('admin_init', array($plugin, 'enqueueJSAndCSSFiles'));
\WP_Mock::expectActionAdded('wp_ajax_passive_indexation_check_update_settings', array($plugin, 'updateSettings'));
\WP_Mock::expectActionAdded('wp_ajax_passive_indexation_check_delete_email', array($plugin, 'deleteNotifierEmail'));
\WP_Mock::expectActionAdded('wp_ajax_passive_indexation_check_add_email', array($plugin, 'addNotifierEmail'));
\WP_Mock::expectActionAdded('admin_menu', array($plugin, 'activateGUI'));
\WP_Mock::expectActionAdded('admin_notices', array($plugin, 'emailNoticeGUI'));
\WP_Mock::expectActionAdded('admin_notices', array($plugin, 'noticeGUI'));
\WP_Mock::expectActionAdded('passive_indexation_check_send_emails', array($plugin, 'sendNotificationEmailsTask'));
$plugin->__construct();
\WP_Mock::assertHooksAdded();
}