File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 3
3
namespace lloc \MslsTests ;
4
4
5
5
use Brain \Monkey \Functions ;
6
+ use Brain \Monkey \Actions ;
6
7
use lloc \Msls \MslsBlog ;
7
8
use lloc \Msls \MslsBlogCollection ;
8
9
use lloc \Msls \MslsOptions ;
@@ -34,6 +35,28 @@ protected function setUp(): void {
34
35
$ this ->test = new MslsPostTag ( $ options , $ collection );
35
36
}
36
37
38
+ public function test_init () {
39
+ $ options = \Mockery::mock ( MslsOptions::class );
40
+ $ options ->activate_autocomplete = true ;
41
+
42
+ $ collection = \Mockery::mock ( MslsBlogCollection::class );
43
+
44
+ $ taxonomy = \Mockery::mock ( MslsTaxonomy::class );
45
+ $ taxonomy ->shouldReceive ( 'acl_request ' )->once ()->andReturn ( 'post_tag ' );
46
+
47
+ Functions \expect ( 'msls_options ' )->atLeast ()->once ()->andReturn ( $ options );
48
+ Functions \expect ( 'msls_blog_collection ' )->atLeast ()->once ()->andReturn ( $ collection );
49
+ Functions \expect ( 'msls_content_types ' )->atLeast ()->once ()->andReturn ( $ taxonomy );
50
+
51
+ Actions \expectAdded ( 'post_tag_edit_form_fields ' )->once ();
52
+ Actions \expectAdded ( 'post_tag_add_form_fields ' )->once ();
53
+ Actions \expectAdded ( 'edited_post_tag ' )->once ();
54
+ Actions \expectAdded ( 'create_post_tag ' )->once ();
55
+
56
+ $ this ->expectNotToPerformAssertions ();
57
+ MslsPostTag::init ();
58
+ }
59
+
37
60
/**
38
61
* Verify the static suggest-method
39
62
*/
You can’t perform that action at this time.
0 commit comments