Passed
Pull Request — master (#12)
by
unknown
01:56
created

FactoryTest::testCreateController()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015-2019
6
 */
7
8
9
namespace Aimeos\Controller\Jobs\Catalog\Export\Sitemap;
10
11
12
class FactoryTest extends \PHPUnit\Framework\TestCase
1 ignored issue
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
	public function testCreateController()
15
	{
16
		$context = \TestHelperJobs::getContext();
17
		$aimeos = \TestHelperJobs::getAimeos();
18
19
		$obj = \Aimeos\Controller\Jobs\Catalog\Export\Sitemap\Factory::create( $context, $aimeos );
20
		$this->assertInstanceOf( '\\Aimeos\\Controller\\Jobs\\Iface', $obj);
21
	}
22
23
24
	public function testFactoryExceptionWrongName()
25
	{
26
		$context = \TestHelperJobs::getContext();
27
		$aimeos = \TestHelperJobs::getAimeos();
28
29
		$this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' );
30
		\Aimeos\Controller\Jobs\Catalog\Export\Sitemap\Factory::create( $context, $aimeos, 'Wrong$$$Name' );
31
	}
32
33
34
	public function testFactoryExceptionWrongClass()
35
	{
36
		$context = \TestHelperJobs::getContext();
37
		$aimeos = \TestHelperJobs::getAimeos();
38
39
		$this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' );
40
		\Aimeos\Controller\Jobs\Catalog\Export\Sitemap\Factory::create( $context, $aimeos, 'WrongClass' );
41
	}
42
43
44
	public function testFactoryExceptionWrongInterface()
45
	{
46
		$context = \TestHelperJobs::getContext();
47
		$aimeos = \TestHelperJobs::getAimeos();
48
49
		$this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' );
50
		\Aimeos\Controller\Jobs\Catalog\Export\Sitemap\Factory::create( $context, $aimeos, 'Factory' );
51
	}
52
}