@@ 61-72 (lines=12) @@ | ||
58 | } |
|
59 | ||
60 | ||
61 | public function testGetItem() |
|
62 | { |
|
63 | $search = $this->object->createSearch(); |
|
64 | $search->setSlice(0, 1); |
|
65 | $results = $this->object->searchItems( $search ); |
|
66 | ||
67 | if( ( $item = reset( $results ) ) === false ) { |
|
68 | throw new \RuntimeException( 'No item found' ); |
|
69 | } |
|
70 | ||
71 | $this->assertEquals( $item, $this->object->getItem( $item->getId() ) ); |
|
72 | } |
|
73 | ||
74 | ||
75 | public function testSaveUpdateDeleteItem() |
@@ 45-56 (lines=12) @@ | ||
42 | } |
|
43 | ||
44 | ||
45 | public function testGetItem() |
|
46 | { |
|
47 | $search = $this->object->createSearch(); |
|
48 | $search->setSlice(0, 1); |
|
49 | $results = $this->object->searchItems($search); |
|
50 | ||
51 | if( ( $expected = reset($results) ) === false ) { |
|
52 | throw new \RuntimeException( 'No list type item found' ); |
|
53 | } |
|
54 | ||
55 | $this->assertEquals( $expected, $this->object->getItem( $expected->getId() ) ); |
|
56 | } |
|
57 | ||
58 | ||
59 | public function testGetSubManager() |
@@ 96-108 (lines=13) @@ | ||
93 | $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Address\\Iface', $this->object->createItem() ); |
|
94 | } |
|
95 | ||
96 | public function testGetItem() |
|
97 | { |
|
98 | $search = $this->object->createSearch(); |
|
99 | $search->setConditions( $search->compare( '~=', 'customer.address.company', 'ABC GmbH' ) ); |
|
100 | ||
101 | $items = $this->object->searchItems( $search ); |
|
102 | ||
103 | if( ( $item = reset( $items ) ) === false ) { |
|
104 | throw new \RuntimeException( 'No address item with company "ABC" found' ); |
|
105 | } |
|
106 | ||
107 | $this->assertEquals( $item, $this->object->getItem( $item->getId() ) ); |
|
108 | } |
|
109 | ||
110 | public function testSaveUpdateDeleteItem() |
|
111 | { |