File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change 4
4
5
5
use Brain \Monkey \Functions ;
6
6
use lloc \Msls \MslsOptionsTax ;
7
+ use lloc \Msls \MslsOptionsTaxTerm ;
8
+ use lloc \Msls \MslsOptionsTaxTermCategory ;
7
9
8
10
class TestMslsOptionsTax extends MslsUnitTestCase {
9
11
10
- protected $ woo ;
11
-
12
12
protected function setUp (): void {
13
13
parent ::setUp ();
14
14
15
- Functions \expect ( 'get_option ' )->once ()->andReturn ( array ( 'de_DE ' => 42 ) );
15
+ Functions \expect ( 'get_option ' )->atLeast ()-> once ()->andReturn ( array ( 'de_DE ' => 42 ) );
16
16
17
17
$ this ->test = new MslsOptionsTax ( 0 );
18
18
}
19
19
20
+ public function test_create_category (): void {
21
+ Functions \expect ( 'get_queried_object_id ' )->once ()->andReturn ( 42 );
22
+ Functions \expect ( 'is_admin ' )->once ()->andReturnFalse ();
23
+ Functions \expect ( 'is_category ' )->once ()->andReturnTrue ();
24
+
25
+ $ this ->assertInstanceOf ( MslsOptionsTaxTermCategory::class, MslsOptionsTax::create () );
26
+ }
27
+
28
+ public function test_create_post_tag (): void {
29
+ Functions \expect ( 'get_queried_object_id ' )->once ()->andReturn ( 42 );
30
+ Functions \expect ( 'is_admin ' )->once ()->andReturnFalse ();
31
+ Functions \expect ( 'is_category ' )->once ()->andReturnFalse ();
32
+ Functions \expect ( 'is_tag ' )->once ()->andReturnTrue ();
33
+
34
+ $ this ->assertInstanceOf ( MslsOptionsTaxTerm::class, MslsOptionsTax::create () );
35
+ }
36
+
20
37
public function test_get_tax_query (): void {
21
38
Functions \expect ( 'is_woocommerce ' )->once ()->andReturn ( false );
22
39
You can’t perform that action at this time.
0 commit comments