| @@ 109-125 (lines=17) @@ | ||
| 106 | } |
|
| 107 | ||
| 108 | ||
| 109 | public function testGetItem() |
|
| 110 | { |
|
| 111 | $search = $this->object->createSearch(); |
|
| 112 | $conditions = array( |
|
| 113 | $search->compare( '~=', 'customer.property.value', '1'), |
|
| 114 | $search->compare( '==', 'customer.property.editor', $this->editor ) |
|
| 115 | ); |
|
| 116 | $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
| 117 | $results = $this->object->searchItems( $search ); |
|
| 118 | ||
| 119 | if( ($expected = reset($results)) === false ) { |
|
| 120 | throw new \RuntimeException( sprintf( 'No customer property item found for value "%1$s".', '1' ) ); |
|
| 121 | } |
|
| 122 | ||
| 123 | $actual = $this->object->getItem( $expected->getId() ); |
|
| 124 | $this->assertEquals( $expected, $actual ); |
|
| 125 | } |
|
| 126 | ||
| 127 | ||
| 128 | public function testGetResourceType() |
|
| @@ 62-81 (lines=20) @@ | ||
| 59 | } |
|
| 60 | ||
| 61 | ||
| 62 | public function testGetItem() |
|
| 63 | { |
|
| 64 | $search = $this->object->createSearch(); |
|
| 65 | $conditions = array( |
|
| 66 | $search->compare( '==', 'customer.property.type.code', 'newsletter' ), |
|
| 67 | $search->compare( '==', 'customer.property.type.editor', $this->editor ) |
|
| 68 | ); |
|
| 69 | $search->setConditions( $search->combine( '&&', $conditions ) ); |
|
| 70 | ||
| 71 | $results = $this->object->searchItems( $search ); |
|
| 72 | ||
| 73 | if( ($expected = reset($results) ) === false ) |
|
| 74 | { |
|
| 75 | throw new \RuntimeException( 'No property type item found.' ); |
|
| 76 | } |
|
| 77 | ||
| 78 | $actual = $this->object->getItem( $expected->getId() ); |
|
| 79 | ||
| 80 | $this->assertEquals( $expected, $actual ); |
|
| 81 | } |
|
| 82 | ||
| 83 | ||
| 84 | public function testSaveInvalid() |
|