66 */
77
88/**
9- * Plugin Test
9+ * Plugin_Test
1010 */
1111final class Plugin_Test extends WP_UnitTestCase {
1212
1313 /**
1414 * Test onload
1515 *
16- * @covers OneCMS\Taxonomy_Paths\Plugin::activate
17- */
18- public function test_activate () {
19- $ plugin = new OneCMS \Taxonomy_Paths \Plugin ();
20-
21- $ this ->assertNull (
22- $ plugin ->activate ()
23- );
24- }
25-
26- /**
27- * Test onload
28- *
29- * @covers OneCMS\Taxonomy_Paths\Plugin::onload
16+ * @covers <%= PRIMARY_NAMESPACE %>\<%= SECONDARY_NAMESPACE %>\Plugin::onload
3017 */
3118 public function test_onload () {
3219 $ instance = new stdClass ();
33- $ plugin = new OneCMS \Taxonomy_Paths \Plugin ();
20+ $ plugin = new <%= PRIMARY_NAMESPACE %>\<%= SECONDARY_NAMESPACE %>\Plugin ();
21+ $ result = $ plugin ->onload ( $ instance );
3422
35- $ this ->assertNull (
36- $ plugin ->onload ( $ instance )
37- );
23+ $ this ->assertNull ( $ result );
3824 }
3925
4026 /**
4127 * Test init
4228 *
43- * @covers OneCMS\Taxonomy_Paths \Plugin::init
29+ * @covers <%= PRIMARY_NAMESPACE %>\<%= SECONDARY_NAMESPACE %> \Plugin::init
4430 */
4531 public function test_init () {
4632 global $ wp_actions ;
4733
48- $ plugin = new OneCMS \Taxonomy_Paths \Plugin ();
49- $ init = $ plugin ->init ();
34+ $ plugin = new <%= PRIMARY_NAMESPACE %>\<%= SECONDARY_NAMESPACE %>\Plugin ();
35+ $ result = $ plugin ->init ();
36+
37+ $ this ->assertTrue ( isset ( $ wp_actions ['<%= US_SLUG %>_before_init ' ] ) );
38+ $ this ->assertTrue ( isset ( $ wp_actions ['<%= US_SLUG %>_after_init ' ] ) );
5039
51- $ this ->assertTrue ( isset ( $ wp_actions ['onecms_taxonomy_paths_before_init ' ] ) );
52- $ this ->assertTrue ( isset ( $ wp_actions ['onecms_taxonomy_paths_after_init ' ] ) );
53- $ this ->assertNotFalse (
54- has_filter (
55- 'onecms_enable_taxonomy_paths ' ,
56- false
57- )
58- );
59- $ this ->assertNull ( $ init );
40+ $ this ->assertNull ( $ result );
6041 }
6142
6243 /**
6344 * Test authenticated_init when user is not logged in
6445 *
65- * @covers OneCMS\Taxonomy_Paths \Plugin::authenticated_init
46+ * @covers <%= PRIMARY_NAMESPACE %>\<%= SECONDARY_NAMESPACE %> \Plugin::authenticated_init
6647 */
6748 public function test_authenticated_init_when_user_is_not_logged_in () {
68- $ plugin = new OneCMS \ Taxonomy_Paths \Plugin ();
49+ $ plugin = new <%= PRIMARY_NAMESPACE %>\<%= SECONDARY_NAMESPACE %> \Plugin ();
6950 $ authenticated_init = $ plugin ->authenticated_init ();
7051
7152 $ this ->assertFalse ( isset ( $ plugin ->admin ) );
@@ -75,13 +56,13 @@ public function test_authenticated_init_when_user_is_not_logged_in() {
7556 /**
7657 * Test authenticated_init when user is logged in
7758 *
78- * @covers OneCMS\Taxonomy_Paths \Plugin::authenticated_init
59+ * @covers <%= PRIMARY_NAMESPACE %>\<%= SECONDARY_NAMESPACE %> \Plugin::authenticated_init
7960 */
8061 public function test_authenticated_init_when_user_is_logged_in () {
8162 $ user_id = $ this ->factory ->user ->create ();
8263 wp_set_current_user ( $ user_id );
8364
84- $ plugin = new OneCMS \ Taxonomy_Paths \Plugin ();
65+ $ plugin = new <%= PRIMARY_NAMESPACE %>\<%= SECONDARY_NAMESPACE %> \Plugin ();
8566 $ authenticated_init = $ plugin ->authenticated_init ();
8667
8768 $ this ->assertTrue ( isset ( $ plugin ->admin ) );
0 commit comments