FactoryTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 27
c 1
b 0
f 0
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreateManagerInvalidName() 0 4 1
A testCreateManagerNotExisting() 0 4 1
A testCreateManagerName() 0 4 1
A testCreateManager() 0 4 1
1
<?php
2
3
/**
4
 * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2021
6
 */
7
8
9
namespace Aimeos\MShop\Cms\Manager;
10
11
12
/**
13
 * Test class for \Aimeos\MShop\Cms\Manager\Factory.
14
 */
15
class FactoryTest 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...
16
{
17
	public function testCreateManager()
18
	{
19
		$manager = \Aimeos\MShop\Cms\Manager\Factory::create( \TestHelperMShop::getContext() );
20
		$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $manager );
21
	}
22
23
24
	public function testCreateManagerName()
25
	{
26
		$manager = \Aimeos\MShop\Cms\Manager\Factory::create( \TestHelperMShop::getContext(), 'Standard' );
27
		$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $manager );
28
	}
29
30
31
	public function testCreateManagerInvalidName()
32
	{
33
		$this->expectException( \Aimeos\MShop\Cms\Exception::class );
34
		\Aimeos\MShop\Cms\Manager\Factory::create( \TestHelperMShop::getContext(), '%^&' );
35
	}
36
37
38
	public function testCreateManagerNotExisting()
39
	{
40
		$this->expectException( \Aimeos\MShop\Exception::class );
41
		\Aimeos\MShop\Cms\Manager\Factory::create( \TestHelperMShop::getContext(), 'unknown' );
42
	}
43
}
44