1 | <?php |
||
10 | class Partner_Test extends TestCase { |
||
11 | |||
12 | const TEST_CODE = 'abc-123'; |
||
13 | |||
14 | public function tearDown() { |
||
17 | |||
18 | public function setUp() { |
||
23 | |||
24 | public function test_init_returns_instance() { |
||
27 | |||
28 | public function code_provider() { |
||
44 | |||
45 | /** |
||
46 | * @dataProvider code_provider |
||
47 | * |
||
48 | * @param string $code_type Partner code type. |
||
49 | * @param string $option_name Option and filter name. |
||
50 | * @param string $query_string_name Query string variable name. |
||
51 | * |
||
52 | * @throws Monkey\Expectation\Exception\ExpectationArgsRequired |
||
53 | */ |
||
54 | public function test_partner_code_is_empty_by_default( $code_type, $option_name, $query_string_name ) { |
||
55 | Functions\expect( 'get_option' )->once()->with( $option_name )->andReturn( '' ); |
||
56 | $this->assertEmpty( Partner::init()->get_partner_code( $code_type ) ); |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @dataProvider code_provider |
||
61 | * |
||
62 | * @param string $code_type Partner code type. |
||
63 | * @param string $option_name Option and filter name. |
||
64 | * @param string $query_string_name Query string variable name. |
||
65 | * |
||
66 | * @throws Monkey\Expectation\Exception\ExpectationArgsRequired |
||
67 | */ |
||
68 | public function test_partner_code_is_set_via_option( $code_type, $option_name, $query_string_name ) { |
||
72 | |||
73 | /** |
||
74 | * @dataProvider code_provider |
||
75 | * |
||
76 | * @param string $code_type Partner code type. |
||
77 | * @param string $option_name Option and filter name. |
||
78 | * @param string $query_string_name Query string variable name. |
||
79 | * |
||
80 | * @throws Monkey\Expectation\Exception\ExpectationArgsRequired |
||
81 | */ |
||
82 | public function test_partner_code_is_set_via_filter( $code_type, $option_name, $query_string_name ) { |
||
87 | } |
||
88 |