FlowTest::tearDown()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2017-2018
6
 */
7
8
9
namespace Aimeos\MAdmin\Cache\Proxy;
10
11
12
class FlowTest extends \PHPUnit\Framework\TestCase
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
{
14
	private $object;
15
	private $mock;
16
17
18
	protected function setUp()
19
	{
20
		if( class_exists( 'Neos\Cache\Frontend\StringFrontend' ) === false ) {
21
			$this->markTestSkipped( 'Class \\Neos\\Cache\\Frontend\\StringFrontend not found' );
22
		}
23
24
		$localeItem = $this->getMockBuilder( \Aimeos\MShop\Locale\Item\Standard::class )
25
			->setMethods( ['getSiteId'])
26
			->getMock();
27
28
		$this->mock = $this->getMockBuilder( 'Neos\Cache\Frontend\StringFrontend' )
29
			->disableOriginalConstructor()
30
			->getMock();
31
32
		$context = \TestHelper::getContext();
33
		$context->setLocale( $localeItem );
34
35
		$this->object = new \Aimeos\MAdmin\Cache\Proxy\Flow( $context, $this->mock );
36
	}
37
38
39
	protected function tearDown()
40
	{
41
		unset( $this->mock, $this->object );
42
	}
43
44
45
	public function testGetObject()
46
	{
47
		$class = new \ReflectionClass( \Aimeos\MAdmin\Cache\Proxy\Flow::class );
48
		$method = $class->getMethod( 'getObject' );
49
		$method->setAccessible( true );
50
51
		$result = $method->invokeArgs( $this->object, [] );
52
		$this->assertInstanceOf( \Aimeos\MW\Cache\Iface::class, $result );
53
	}
54
}
55