@@ 123-131 (lines=9) @@ | ||
120 | } |
|
121 | */ |
|
122 | ||
123 | protected function mock_site_url() { |
|
124 | $builder = new MockBuilder(); |
|
125 | $builder->setNamespace( "Automattic\Jetpack" ) |
|
126 | ->setName( 'site_url' ) |
|
127 | ->setFunction( function() { |
|
128 | return "unit-test"; |
|
129 | } ); |
|
130 | $builder->build()->enable(); |
|
131 | } |
|
132 | ||
133 | protected function mock_filters( $filters, $namespace ) { |
|
134 | $this->mocked_filters = $filters; |
|
@@ 156-164 (lines=9) @@ | ||
153 | unset( $this->mocked_filters ); |
|
154 | } |
|
155 | ||
156 | protected function mock_add_get_current_screen() { |
|
157 | $builder = new MockBuilder(); |
|
158 | $builder->setNamespace( "Automattic\Jetpack\JITMS" ) |
|
159 | ->setName( 'get_current_screen' ) |
|
160 | ->setFunction( function() { |
|
161 | return new \stdClass; |
|
162 | } ); |
|
163 | $builder->build()->enable(); |
|
164 | } |
|
165 | ||
166 | protected function mock_add_action() { |
|
167 | $builder = new MockBuilder(); |