PluginProbe
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode / 4.7.5
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode v4.7.5
4.7.4 4.7.5 4.7.3 4.7.2 4.7.1 trunk 2.3.0 2.4.0 2.4.1 2.4.2 2.5.0 3.0.0 3.0.1 3.1.0 3.10.0 3.10.1 3.11.1 3.11.2 3.11.3 3.2.0 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 All 95 releases
cookiebot / tests / integration / abilities / Test_Cookiebot_Abilities_Registrar.php

Test_Cookiebot_Abilities_Registrar.php in Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode 4.7.5, at tests/integration/abilities/Test_Cookiebot_Abilities_Registrar.php

52 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Tests for Cookiebot_Abilities_Registrar.
4 *
5 * @package cookiebot
6 * @subpackage tests
7 */
8
9 namespace cybot\cookiebot\tests\integration\abilities;
10
11 use cybot\cookiebot\abilities\Cookiebot_Abilities_Registrar;
12 use WP_UnitTestCase;
13
14 /**
15 * Test class for Cookiebot_Abilities_Registrar.
16 *
17 * @since 4.8.0
18 */
19 class Test_Cookiebot_Abilities_Registrar extends WP_UnitTestCase {
20
21 /**
22 * Test that register_hooks adds both actions.
23 *
24 * @return void
25 */
26 public function test_register_hooks_adds_both_actions() {
27 $registrar = new Cookiebot_Abilities_Registrar();
28 $registrar->register_hooks();
29 $this->assertNotFalse( has_action( 'wp_abilities_api_categories_init', array( $registrar, 'register_category' ) ) );
30 $this->assertNotFalse( has_action( 'wp_abilities_api_init', array( $registrar, 'register' ) ) );
31 }
32
33 /**
34 * Test that all six abilities are registered after hooks fire.
35 *
36 * @return void
37 */
38 public function test_all_six_abilities_are_registered_after_hooks_fire() {
39 $expected = array(
40 'cookiebot/get-status',
41 'cookiebot/verify-setup',
42 'cookiebot/get-compliance-summary',
43 'cookiebot/set-cbid',
44 'cookiebot/toggle-gcm',
45 'cookiebot/install-ppg',
46 );
47 foreach ( $expected as $name ) {
48 $this->assertTrue( wp_has_ability( $name ), "Expected ability '{$name}' to be registered." );
49 }
50 }
51 }
52