Completed
Push — dev ( ce9639...c420bb )
by Josef
04:04
created

MethodTestCase::getRequestMock()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 1
1
<?php
2
3
namespace HelePartnerSyncApi\Method;
4
5
use HelePartnerSyncApi\Request\Request;
6
use PHPUnit_Framework_TestCase;
7
8
abstract class MethodTestCase extends PHPUnit_Framework_TestCase
9
{
10
11
	/**
12
	 * @param mixed $dataToReturn
13
	 * @return Request
14
	 */
15
	protected function getRequestMock($dataToReturn)
16
	{
17
		$request = $this->getMockBuilder('HelePartnerSyncApi\Request\Request')
18
			->disableOriginalConstructor()
19
			->getMock();
20
21
		$request->expects(self::once())
22
			->method('getData')
23
			->willReturn($dataToReturn);
24
25
		return $request;
26
	}
27
28
}
29