Completed
Push — update/add_grunion_after_feedb... ( 614f06...9f6c1a )
by
unknown
07:04
created

Hooks::build_mock_actions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
1
<?php
2
/**
3
 * The trait allows the "options" mock functions to be reused.
4
 *
5
 * @package automattic/jetpack-connection
6
 */
7
8
namespace Automattic\Jetpack\Connection\Test\Mock;
9
10
use Automattic\Jetpack\Connection;
11
use phpmock\Mock;
12
use phpmock\MockBuilder;
13
14
trait Hooks {
15
16
	/**
17
	 * Mock for the `do_action()` function.
18
	 *
19
	 * @var Mock
20
	 */
21
	private $do_action;
22
23
	/**
24
	 * Build mocks for the "options" functionality.
25
	 */
26
	private function build_mock_actions() {
27
		$builder = new MockBuilder();
28
		$builder->setNamespace( Connection::class )
29
			->setName( 'do_action' )
30
			->setFunction(
31
				// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
32
				function ( $tag ) {
33
					// Left blank intentionally.
34
				}
35
			);
36
		$this->do_action = $builder->build();
37
	}
38
39
}
40