1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @license LGPLv3, http://opensource.org/licenses/LGPL-3.0 |
5
|
|
|
* @copyright Aimeos (aimeos.org), 2016-2018 |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
|
9
|
|
|
namespace Aimeos\MShop\Customer\Manager\Lists; |
10
|
|
|
|
11
|
|
|
|
12
|
|
|
class EzpublishTest extends \PHPUnit\Framework\TestCase |
13
|
|
|
{ |
14
|
|
|
private $object; |
15
|
|
|
|
16
|
|
|
|
17
|
|
|
protected function setUp() : void |
18
|
|
|
{ |
19
|
|
|
$manager = \Aimeos\MShop\Customer\Manager\Factory::create( \TestHelper::getContext(), 'Ezpublish' ); |
20
|
|
|
$this->object = $manager->getSubManager( 'lists', 'Ezpublish' ); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
|
24
|
|
|
protected function tearDown() : void |
25
|
|
|
{ |
26
|
|
|
unset( $this->object ); |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
|
30
|
|
|
public function testClear() |
31
|
|
|
{ |
32
|
|
|
$this->assertInstanceOf( \Aimeos\MShop\Common\Manager\Iface::class, $this->object->clear( array( -1 ) ) ); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
|
36
|
|
|
public function testGetSearchAttributes() |
37
|
|
|
{ |
38
|
|
|
$attributes = $this->object->getSearchAttributes(); |
39
|
|
|
$this->assertGreaterThan( 0, count( $attributes ) ); |
40
|
|
|
|
41
|
|
|
foreach( $attributes as $attribute ) { |
42
|
|
|
$this->assertInstanceOf( \Aimeos\MW\Criteria\Attribute\Iface::class, $attribute ); |
43
|
|
|
} |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
|
47
|
|
|
public function testGetSubManager() |
48
|
|
|
{ |
49
|
|
|
$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'type' ) ); |
50
|
|
|
$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Manager\\Iface', $this->object->getSubManager( 'type', 'Standard' ) ); |
51
|
|
|
|
52
|
|
|
$this->expectException( '\\Aimeos\\MShop\\Exception' ); |
53
|
|
|
$this->object->getSubManager( 'unknown' ); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
|
57
|
|
|
public function testSaveItemInvalidDomain() |
58
|
|
|
{ |
59
|
|
|
$item = $this->object->createItem(); |
60
|
|
|
$item->setDomain( 'customer/group' ); |
61
|
|
|
|
62
|
|
|
$this->expectException( \Aimeos\MShop\Customer\Exception::class ); |
63
|
|
|
$this->object->saveItem( $item ); |
64
|
|
|
} |
65
|
|
|
} |
66
|
|
|
|