1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Aimeos\Admin\JQAdm\Product; |
4
|
|
|
|
5
|
|
|
|
6
|
|
|
/** |
7
|
|
|
* @license LGPLv3, http://opensource.org/licenses/LGPL-3.0 |
8
|
|
|
* @copyright Aimeos (aimeos.org), 2016 |
9
|
|
|
*/ |
10
|
|
|
class FactoryTest extends \PHPUnit_Framework_TestCase |
11
|
|
|
{ |
12
|
|
|
private $context; |
13
|
|
|
private $templatePaths; |
14
|
|
|
|
15
|
|
|
|
16
|
|
|
protected function setUp() |
17
|
|
|
{ |
18
|
|
|
$this->templatePaths = \TestHelperJqadm::getTemplatePaths(); |
19
|
|
|
$this->context = \TestHelperJqadm::getContext(); |
20
|
|
|
$this->context->setView( \TestHelperJqadm::getView() ); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
|
24
|
|
|
public function testCreateClient() |
25
|
|
|
{ |
26
|
|
|
$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, $this->templatePaths ); |
27
|
|
|
$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
|
31
|
|
|
public function testCreateClientName() |
32
|
|
|
{ |
33
|
|
|
$client = \Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, $this->templatePaths, 'Standard' ); |
34
|
|
|
$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client ); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
|
38
|
|
|
public function testCreateClientNameEmpty() |
39
|
|
|
{ |
40
|
|
|
$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
|
|
|
41
|
|
|
\Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, $this->templatePaths, '' ); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
|
45
|
|
|
public function testCreateClientNameInvalid() |
46
|
|
|
{ |
47
|
|
|
$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
|
|
|
48
|
|
|
\Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, $this->templatePaths, '%product' ); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
|
52
|
|
|
public function testCreateClientNameNotFound() |
53
|
|
|
{ |
54
|
|
|
$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' ); |
|
|
|
|
55
|
|
|
\Aimeos\Admin\JQAdm\Product\Factory::createClient( $this->context, $this->templatePaths, 'test' ); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
} |
59
|
|
|
|
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.