2
0
Просмотр исходного кода

moved xml tag attributes fetching to a method in Zend_Service_Ebay_Finding objects

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23110 44c647ce-9c0f-0410-b52a-842ac1e357ba
renanbr 15 лет назад
Родитель
Сommit
5ee638ef62

+ 1 - 1
documentation/manual/en/module_specs/Zend_Service_Ebay_Finding.xml

@@ -87,7 +87,7 @@ foreach ($response->searchResult->item as $item) {
     $item->listingInfo->viewItemURL;
 
     // inner call, find for items of same current product
-    // like $finding->findItemsByProduct($item->productId, $item->productId_type)
+    // like $finding->findItemsByProduct($item->productId, $item->attributes('productId', 'type'))
     $response2 = $item->findItemsByProduct($finding);
 
     // inner call, find for items of same store

+ 27 - 0
library/Zend/Service/Ebay/Finding/Abstract.php

@@ -50,6 +50,11 @@ abstract class Zend_Service_Ebay_Finding_Abstract
     protected $_xPath;
 
     /**
+     * @var array
+     */
+    protected $_attributes = array();
+
+    /**
      * @param  DOMElement $dom
      * @return void
      */
@@ -61,6 +66,28 @@ abstract class Zend_Service_Ebay_Finding_Abstract
     }
 
     /**
+     * @param  string $tag
+     * @param  string $attribute
+     * @return mixed
+     */
+    public function attributes($tag, $attribute = null)
+    {
+        if (null === $attribute) {
+            // all attributes
+            if (array_key_exists($tag, $this->_attributes)) {
+                return $this->_attributes[$tag];
+            }
+            return array();
+        }
+
+        // a specific attribute
+        if (isset($this->_attributes[$tag][$attribute])) {
+            return $this->_attributes[$tag][$attribute];
+        }
+        return null;
+    }
+
+    /**
      * Initialize object.
      *
      * Post construct logic, classes must read their members here. Called from

+ 3 - 14
library/Zend/Service/Ebay/Finding/Aspect.php

@@ -45,19 +45,6 @@ class Zend_Service_Ebay_Finding_Aspect extends Zend_Service_Ebay_Finding_Abstrac
     public $valueHistogram;
 
     /**
-     * Name of an aspect value.
-     *
-     * Use array key to associate a name from this attribute to value set.
-     *
-     * For example, "Short Sleeve" could be an aspect value of the Sleeve Style
-     * aspect in the Women's Dresses domain, or "Athletic" could be an aspect
-     * value of the Style aspect in the Men's Shoes domain.
-     *
-     * @var string[]
-     */
-    public $valueHistogram_valueName;
-
-    /**
      * @return void
      */
     protected function _init()
@@ -65,7 +52,9 @@ class Zend_Service_Ebay_Finding_Aspect extends Zend_Service_Ebay_Finding_Abstrac
         parent::_init();
         $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
 
-        $this->valueHistogram_valueName = $this->_query(".//$ns:valueHistogram/@valueName", 'string', true);
+        $this->_attributes['valueHistogram'] = array(
+            'valueName' => $this->_query(".//$ns:valueHistogram/@valueName", 'string', true)
+        );
 
         $nodes = $this->_xPath->query(".//$ns:valueHistogram", $this->_dom);
         if ($nodes->length > 0) {

+ 4 - 17
library/Zend/Service/Ebay/Finding/Aspect/Histogram/Container.php

@@ -59,22 +59,6 @@ class Zend_Service_Ebay_Finding_Aspect_Histogram_Container extends Zend_Service_
     public $aspect;
 
     /**
-     * Names of aspects that is part of a domain.
-     *
-     * Use array key to associate a name from this attribute to aspect set. This
-     * value is not returned if there are no matching aspects for the associated
-     * domain.
-     *
-     * For example, "Optical Zoom" or "Megapixels" could be aspects of the
-     * Digital Cameras domain. For the current aspect names associated with a
-     * specific item, refer to the aspectHistogramContainer returned for the
-     * respective item.
-     *
-     * @var string[]
-     */
-    public $aspect_name = array();
-
-    /**
      * A buy-side group of items, for example "Shoes.".
      *
      * Domains are extracted from item listing properties, such as the title,
@@ -103,10 +87,13 @@ class Zend_Service_Ebay_Finding_Aspect_Histogram_Container extends Zend_Service_
         parent::_init();
         $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
 
-        $this->aspect_name       = $this->_query(".//$ns:aspect/@name", 'string', true);
         $this->domainDisplayName = $this->_query(".//$ns:domainDisplayName[1]", 'string');
         $this->domainName        = $this->_query(".//$ns:domainName[1]", 'string');
 
+        $this->_attributes['aspect'] = array(
+            'name' => $this->_query(".//$ns:aspect/@name", 'string', true)
+        );
+
         $nodes = $this->_xPath->query(".//$ns:aspect", $this->_dom);
         if ($nodes->length > 0) {
             /**

+ 12 - 20
library/Zend/Service/Ebay/Finding/Error/Data.php

@@ -90,17 +90,6 @@ class Zend_Service_Ebay_Finding_Error_Data extends Zend_Service_Ebay_Finding_Abs
     public $parameter;
 
     /**
-     * The name of the input parameter returned with the error.
-     *
-     * Inspecting the parameter (or its input value) will often aid in
-     * understanding the cause of the error. Not all error messages contain this
-     * value.
-     *
-     * @var string[]
-     */
-    public $parameter_name;
-
-    /**
      * Indicates whether the reported problem is fatal (an error) or is
      * less-severe (a warning). Review the error message details for information
      * on the cause.
@@ -153,14 +142,17 @@ class Zend_Service_Ebay_Finding_Error_Data extends Zend_Service_Ebay_Finding_Abs
         parent::_init();
         $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
 
-        $this->category       = $this->_query(".//$ns:category[1]", 'string');
-        $this->domain         = $this->_query(".//$ns:domain[1]", 'string');
-        $this->errorId        = $this->_query(".//$ns:errorId[1]", 'integer');
-        $this->exceptionId    = $this->_query(".//$ns:exceptionId[1]", 'string');
-        $this->message        = $this->_query(".//$ns:message[1]", 'string');
-        $this->parameter      = $this->_query(".//$ns:parameter", 'string', true);
-        $this->parameter_name = $this->_query(".//$ns:parameter/@name", 'string', true);
-        $this->severity       = $this->_query(".//$ns:severity[1]", 'string');
-        $this->subdomain      = $this->_query(".//$ns:subdomain[1]", 'string');
+        $this->category    = $this->_query(".//$ns:category[1]", 'string');
+        $this->domain      = $this->_query(".//$ns:domain[1]", 'string');
+        $this->errorId     = $this->_query(".//$ns:errorId[1]", 'integer');
+        $this->exceptionId = $this->_query(".//$ns:exceptionId[1]", 'string');
+        $this->message     = $this->_query(".//$ns:message[1]", 'string');
+        $this->parameter   = $this->_query(".//$ns:parameter", 'string', true);
+        $this->severity    = $this->_query(".//$ns:severity[1]", 'string');
+        $this->subdomain   = $this->_query(".//$ns:subdomain[1]", 'string');
+
+        $this->_attributes['parameter'] = array(
+            'name' => $this->_query(".//$ns:parameter/@name", 'string', true)
+        );
     }
 }

+ 16 - 26
library/Zend/Service/Ebay/Finding/ListingInfo.php

@@ -79,14 +79,6 @@ class Zend_Service_Ebay_Finding_ListingInfo extends Zend_Service_Ebay_Finding_Ab
     public $buyItNowPrice;
 
     /**
-     * Currency in which the monetary amount is specified.
-     *
-     * @link http://developer.ebay.com/DevZone/finding/CallRef/Enums/currencyIdList.html
-     * @var  string
-     */
-    public $buyItNowPrice_currencyId;
-
-    /**
      * The listing's Buy It Now Price (if any), converted into the currency of
      * the site to which you sent your search request.
      *
@@ -104,14 +96,6 @@ class Zend_Service_Ebay_Finding_ListingInfo extends Zend_Service_Ebay_Finding_Ab
     public $convertedBuyItNowPrice;
 
     /**
-     * Currency in which the monetary amount is specified.
-     *
-     * @link http://developer.ebay.com/DevZone/finding/CallRef/Enums/currencyIdList.html
-     * @var  string
-     */
-    public $convertedBuyItNowPrice_currencyId;
-
-    /**
      * Time stamp specifying when the listing is scheduled to end, or the actual
      * end time if the item listing has ended.
      *
@@ -207,15 +191,21 @@ class Zend_Service_Ebay_Finding_ListingInfo extends Zend_Service_Ebay_Finding_Ab
         parent::_init();
         $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
 
-        $this->bestOfferEnabled                  = $this->_query(".//$ns:bestOfferEnabled[1]", 'boolean');
-        $this->buyItNowAvailable                 = $this->_query(".//$ns:buyItNowAvailable[1]", 'boolean');
-        $this->buyItNowPrice                     = $this->_query(".//$ns:buyItNowPrice[1]", 'float');
-        $this->buyItNowPrice_currencyId          = $this->_query(".//$ns:buyItNowPrice[1]/@currencyId[1]", 'string');
-        $this->convertedBuyItNowPrice            = $this->_query(".//$ns:convertedBuyItNowPrice[1]", 'float');
-        $this->convertedBuyItNowPrice_currencyId = $this->_query(".//$ns:convertedBuyItNowPrice[1]/@currencyId[1]", 'string');
-        $this->endTime                           = $this->_query(".//$ns:endTime[1]", 'string');
-        $this->gift                              = $this->_query(".//$ns:gift[1]", 'boolean');
-        $this->listingType                       = $this->_query(".//$ns:listingType[1]", 'string');
-        $this->startTime                         = $this->_query(".//$ns:startTime[1]", 'string');
+        $this->bestOfferEnabled       = $this->_query(".//$ns:bestOfferEnabled[1]", 'boolean');
+        $this->buyItNowAvailable      = $this->_query(".//$ns:buyItNowAvailable[1]", 'boolean');
+        $this->buyItNowPrice          = $this->_query(".//$ns:buyItNowPrice[1]", 'float');
+        $this->convertedBuyItNowPrice = $this->_query(".//$ns:convertedBuyItNowPrice[1]", 'float');
+        $this->endTime                = $this->_query(".//$ns:endTime[1]", 'string');
+        $this->gift                   = $this->_query(".//$ns:gift[1]", 'boolean');
+        $this->listingType            = $this->_query(".//$ns:listingType[1]", 'string');
+        $this->startTime              = $this->_query(".//$ns:startTime[1]", 'string');
+
+        $this->_attributes['buyItNowPrice'] = array(
+            'currencyId' => $this->_query(".//$ns:buyItNowPrice[1]/@currencyId[1]", 'string')
+        );
+
+        $this->_attributes['convertedBuyItNowPrice'] = array(
+            'currencyId' => $this->_query(".//$ns:convertedBuyItNowPrice[1]/@currencyId[1]", 'string')
+        );
     }
 }

+ 3 - 12
library/Zend/Service/Ebay/Finding/Response/Items.php

@@ -64,17 +64,6 @@ class Zend_Service_Ebay_Finding_Response_Items extends Zend_Service_Ebay_Finding
     public $searchResult;
 
     /**
-     * The total number of items returned in the search response.
-     *
-     * This is often equal to the entriesPerPage value. If the count is less
-     * than the specified entriesPerPage, it indicates the end of the result
-     * set.
-     *
-     * @var integer
-     */
-    public $searchResult_count;
-
-    /**
      * @var Zend_Service_Ebay_Finding_Response_Items[]
      */
     protected static $_pageCache = array();
@@ -87,7 +76,9 @@ class Zend_Service_Ebay_Finding_Response_Items extends Zend_Service_Ebay_Finding
         parent::_init();
         $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
 
-        $this->searchResult_count = $this->_query(".//$ns:searchResult[1]/@count[1]", 'string');
+        $this->_attributes['searchResult'] = array(
+            'count' => $this->_query(".//$ns:searchResult[1]/@count[1]", 'string')
+        );
 
         $node = $this->_xPath->query(".//$ns:searchResult[1]", $this->_dom)->item(0);
         if ($node) {

+ 9 - 47
library/Zend/Service/Ebay/Finding/Search/Item.php

@@ -85,15 +85,6 @@ class Zend_Service_Ebay_Finding_Search_Item extends Zend_Service_Ebay_Finding_Ab
     public $distance;
 
     /**
-     * Unit of measure used in a distance calculation.
-     *
-     * Units can be in either kilometers or miles, depending on the Global ID.
-     *
-     * @var string
-     */
-    public $distance_unit;
-
-    /**
      * URL for the Gallery Plus image.
      *
      * The size of Gallery Plus images (up to 400 x 400 pixels) is bigger than
@@ -215,41 +206,6 @@ class Zend_Service_Ebay_Finding_Search_Item extends Zend_Service_Ebay_Finding_Ab
     public $productId;
 
     /**
-     * The nature of the identifier being used. For findItemsByProduct, search
-     * by a single type.
-     *
-     * Applicable values:
-     *
-     *     ReferenceID
-     *     The global reference ID (ePID) for an eBay catalog product. A
-     *     reference ID is a fixed reference to a product, regardless of
-     *     version. Use FindProducts in the Shopping API to determine valid ePID
-     *     values that you can use as input to findItemsByProduct. Each product
-     *     in the response includes its reference ID.
-     *
-     *     ISBN
-     *     ISBN-10 or ISBN-13 value for books. (The string length of ProductID
-     *     indicates whether the ID is 10 or 13 characters.) If you know a
-     *     book's ISBN, you can use this instead of the eBay Reference ID to
-     *     search for that book. Max length of corresponding value: 13
-     *
-     *     UPC
-     *     UPC value for products in Music (e.g., CDs), DVDs & Movies, and Video
-     *     Games categories (or domains). If you know a product's UPC, you can
-     *     use this instead of the eBay Reference ID to search for that product.
-     *     Max length of corresponding value: 12
-     *
-     *     EAN
-     *     EAN value for books. (This is used more commonly in European
-     *     countries.) If you know a book's EAN, you can use this instead of
-     *     the eBay Reference ID to search for that book. Max length of
-     *     corresponding value: 13
-     *
-     * @var string
-     */
-    public $productId_type;
-
-    /**
      * Details about the second category in which the item is listed.
      *
      * This element is not returned if the seller did not specify a secondary
@@ -342,7 +298,6 @@ class Zend_Service_Ebay_Finding_Search_Item extends Zend_Service_Ebay_Finding_Ab
         $this->charityId             = $this->_query(".//$ns:charityId[1]", 'integer');
         $this->country               = $this->_query(".//$ns:country[1]", 'string');
         $this->distance              = $this->_query(".//$ns:distance[1]", 'float');
-        $this->distance_unit         = $this->_query(".//$ns:distance[1]/@unit[1]", 'string');
         $this->galleryPlusPictureURL = $this->_query(".//$ns:galleryPlusPictureURL", 'string', true);
         $this->galleryURL            = $this->_query(".//$ns:galleryURL[1]", 'string');
         $this->globalId              = $this->_query(".//$ns:globalId[1]", 'string');
@@ -351,11 +306,17 @@ class Zend_Service_Ebay_Finding_Search_Item extends Zend_Service_Ebay_Finding_Ab
         $this->paymentMethod         = $this->_query(".//$ns:paymentMethod", 'string', true);
         $this->postalCode            = $this->_query(".//$ns:postalCode[1]", 'string');
         $this->productId             = $this->_query(".//$ns:productId[1]", 'string');
-        $this->productId_type        = $this->_query(".//$ns:productId[1]/@type[1]", 'string');
         $this->subtitle              = $this->_query(".//$ns:subtitle[1]", 'string');
         $this->title                 = $this->_query(".//$ns:title[1]", 'string');
         $this->viewItemURL           = $this->_query(".//$ns:viewItemURL[1]", 'string');
 
+        $this->_attributes['distance'] = array(
+            'unit' => $this->_query(".//$ns:distance[1]/@unit[1]", 'string')
+        );
+        $this->_attributes['productId'] = array(
+            'type' => $this->_query(".//$ns:productId[1]/@type[1]", 'string')
+        );
+
         $node = $this->_xPath->query(".//$ns:listingInfo[1]", $this->_dom)->item(0);
         if ($node) {
             /**
@@ -427,6 +388,7 @@ class Zend_Service_Ebay_Finding_Search_Item extends Zend_Service_Ebay_Finding_Ab
      */
     public function findItemsByProduct(Zend_Service_Ebay_Finding $proxy, $options = null)
     {
-        return $proxy->findItemsByProduct($this->productId, $this->productId_type, $options);
+        $type = $this->attributes('productId', 'type');
+        return $proxy->findItemsByProduct($this->productId, $type, $options);
     }
 }

+ 13 - 23
library/Zend/Service/Ebay/Finding/SellingStatus.php

@@ -51,14 +51,6 @@ class Zend_Service_Ebay_Finding_SellingStatus extends Zend_Service_Ebay_Finding_
     public $convertedCurrentPrice;
 
     /**
-     * Currency in which the monetary amount is specified.
-     *
-     * @link http://developer.ebay.com/DevZone/finding/CallRef/Enums/currencyIdList.html
-     * @var  string
-     */
-    public $convertedCurrentPrice_currencyId;
-
-    /**
      * The current price of the item given in the currency of the site on which
      * the item is listed.
      *
@@ -76,14 +68,6 @@ class Zend_Service_Ebay_Finding_SellingStatus extends Zend_Service_Ebay_Finding_
     public $currentPrice;
 
     /**
-     * Currency in which the monetary amount is specified.
-     *
-     * @link http://developer.ebay.com/DevZone/finding/CallRef/Enums/currencyIdList.html
-     * @var  string
-     */
-    public $currentPrice_currencyId;
-
-    /**
      * Specifies the listing's status in eBay's processing workflow.
      *
      * If an item's EndTime is in the past, but there are no details about the
@@ -129,12 +113,18 @@ class Zend_Service_Ebay_Finding_SellingStatus extends Zend_Service_Ebay_Finding_
         parent::_init();
         $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
 
-        $this->bidCount                         = $this->_query(".//$ns:bidCount[1]", 'integer');
-        $this->convertedCurrentPrice            = $this->_query(".//$ns:convertedCurrentPrice[1]", 'float');
-        $this->convertedCurrentPrice_currencyId = $this->_query(".//$ns:convertedCurrentPrice[1]/@currencyId[1]", 'string');
-        $this->currentPrice                     = $this->_query(".//$ns:currentPrice[1]", 'float');
-        $this->currentPrice_currencyId          = $this->_query(".//$ns:currentPrice[1]/@currencyId[1]", 'string');
-        $this->sellingState                     = $this->_query(".//$ns:sellingState[1]", 'string');
-        $this->timeLeft                         = $this->_query(".//$ns:timeLeft[1]", 'string');
+        $this->bidCount              = $this->_query(".//$ns:bidCount[1]", 'integer');
+        $this->convertedCurrentPrice = $this->_query(".//$ns:convertedCurrentPrice[1]", 'float');
+        $this->currentPrice          = $this->_query(".//$ns:currentPrice[1]", 'float');
+        $this->sellingState          = $this->_query(".//$ns:sellingState[1]", 'string');
+        $this->timeLeft              = $this->_query(".//$ns:timeLeft[1]", 'string');
+
+        $this->_attributes['convertedCurrentPrice'] = array(
+            'currencyId' => $this->_query(".//$ns:convertedCurrentPrice[1]/@currencyId[1]", 'string')
+        );
+
+        $this->_attributes['currentPrice'] = array(
+            'currencyId' => $this->_query(".//$ns:currentPrice[1]/@currencyId[1]", 'string')
+        );
     }
 }

+ 7 - 12
library/Zend/Service/Ebay/Finding/ShippingInfo.php

@@ -43,14 +43,6 @@ class Zend_Service_Ebay_Finding_ShippingInfo extends Zend_Service_Ebay_Finding_A
     public $shippingServiceCost;
 
     /**
-     * Currency in which the monetary amount is specified.
-     *
-     * @link http://developer.ebay.com/DevZone/finding/CallRef/Enums/currencyIdList.html
-     * @var  string
-     */
-    public $shippingServiceCost_currencyId;
-
-    /**
      * The shipping method that was used for determining the cost of shipping.
      *
      * For example: flat rate, calculated, or free. The seller specifies the
@@ -123,9 +115,12 @@ class Zend_Service_Ebay_Finding_ShippingInfo extends Zend_Service_Ebay_Finding_A
         parent::_init();
         $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
 
-        $this->shippingServiceCost            = $this->_query(".//$ns:shippingServiceCost[1]", 'float');
-        $this->shippingServiceCost_currencyId = $this->_query(".//$ns:shippingServiceCost[1]/@currencyId[1]", 'string');
-        $this->shippingType                   = $this->_query(".//$ns:shippingType[1]", 'string');
-        $this->shipToLocations                = $this->_query(".//$ns:shipToLocations", 'string', true);
+        $this->shippingServiceCost = $this->_query(".//$ns:shippingServiceCost[1]", 'float');
+        $this->shippingType        = $this->_query(".//$ns:shippingType[1]", 'string');
+        $this->shipToLocations     = $this->_query(".//$ns:shipToLocations", 'string', true);
+
+        $this->_attributes['shippingServiceCost'] = array(
+            'currencyId' => $this->_query(".//$ns:shippingServiceCost[1]/@currencyId[1]", 'string')
+        );
     }
 }

+ 10 - 10
tests/Zend/Service/Ebay/Finding/OfflineTest.php

@@ -123,7 +123,7 @@ class Zend_Service_Ebay_OfflineTest extends PHPUnit_Framework_TestCase
         $this->assertNotNull($object->errorId);
         $this->assertNotNull($object->message);
         $this->assertType('array', $object->parameter);
-        $this->assertType('array', $object->parameter_name);
+        $this->assertType('array', $object->attributes('parameter', 'name'));
         $this->assertNotNull($object->severity);
         $this->assertNotNull($object->subdomain);
 
@@ -146,7 +146,7 @@ class Zend_Service_Ebay_OfflineTest extends PHPUnit_Framework_TestCase
 
         $this->assertType('Zend_Service_Ebay_Finding_PaginationOutput', $response->paginationOutput);
         $this->assertType('Zend_Service_Ebay_Finding_Search_Result', $response->searchResult);
-        $this->assertNotNull($response->searchResult_count);
+        $this->assertNotNull($response->attributes('searchResult', 'count'));
     }
 
     public function testPaginationOutput()
@@ -203,7 +203,7 @@ class Zend_Service_Ebay_OfflineTest extends PHPUnit_Framework_TestCase
         $response->searchResult->item->seek(3);
         $object = $response->searchResult->item->current();
         $this->assertNotNull($object->productId);
-        $this->assertNotNull($object->productId_type);
+        $this->assertNotNull($object->attributes('productId', 'type'));
 
         // sub category
         $response->searchResult->item->seek(2);
@@ -213,7 +213,7 @@ class Zend_Service_Ebay_OfflineTest extends PHPUnit_Framework_TestCase
         // missing attributes in XML
         //$this->assertNotNull($object->charityId);
         //$this->assertNotNull($object->distance);
-        //$this->assertNotNull($object->distance_unit);
+        //$this->assertNotNull($object->attributes('distance', 'unit'));
     }
 
     public function testListingInfo()
@@ -226,9 +226,9 @@ class Zend_Service_Ebay_OfflineTest extends PHPUnit_Framework_TestCase
         $this->assertNotNull($object->bestOfferEnabled);
         $this->assertNotNull($object->buyItNowAvailable);
         $this->assertNotNull($object->buyItNowPrice);
-        $this->assertNotNull($object->buyItNowPrice_currencyId);
+        $this->assertNotNull($object->attributes('buyItNowPrice', 'currencyId'));
         $this->assertNotNull($object->convertedBuyItNowPrice);
-        $this->assertNotNull($object->convertedBuyItNowPrice_currencyId);
+        $this->assertNotNull($object->attributes('convertedBuyItNowPrice', 'currencyId'));
         $this->assertNotNull($object->endTime);
         $this->assertNotNull($object->gift);
         $this->assertNotNull($object->listingType);
@@ -269,9 +269,9 @@ class Zend_Service_Ebay_OfflineTest extends PHPUnit_Framework_TestCase
         $object = $response->searchResult->item->current()->sellingStatus;
         $this->assertNotNull($object->bidCount);
         $this->assertNotNull($object->convertedCurrentPrice);
-        $this->assertNotNull($object->convertedCurrentPrice_currencyId);
+        $this->assertNotNull($object->attributes('convertedCurrentPrice', 'currencyId'));
         $this->assertNotNull($object->currentPrice);
-        $this->assertNotNull($object->currentPrice_currencyId);
+        $this->assertNotNull($object->attributes('currentPrice', 'currencyId'));
         $this->assertNotNull($object->sellingState);
         $this->assertNotNull($object->timeLeft);
     }
@@ -284,7 +284,7 @@ class Zend_Service_Ebay_OfflineTest extends PHPUnit_Framework_TestCase
         $response->searchResult->item->seek(0);
         $object = $response->searchResult->item->current()->shippingInfo;
         $this->assertNotNull($object->shippingServiceCost);
-        $this->assertNotNull($object->shippingServiceCost_currencyId);
+        $this->assertNotNull($object->attributes('shippingServiceCost', 'currencyId'));
         $this->assertNotNull($object->shippingType);
         $this->assertType('array', $object->shipToLocations);
         $this->assertNotNull($object->shipToLocations[0]);
@@ -318,7 +318,7 @@ class Zend_Service_Ebay_OfflineTest extends PHPUnit_Framework_TestCase
         // Zend_Service_Ebay_Finding_Aspect
         $object = $object->aspect->current();
         $this->assertType('Zend_Service_Ebay_Finding_Aspect_Histogram_Value_Set', $object->valueHistogram);
-        $this->assertType('array', $object->valueHistogram_valueName);
+        $this->assertType('array', $object->attributes('valueHistogram', 'valueName'));
 
         // Zend_Service_Ebay_Finding_Aspect_Histogram_Value
         $object = $object->valueHistogram->current();

+ 3 - 3
tests/Zend/Service/Ebay/Finding/OnlineTest.php

@@ -77,17 +77,17 @@ class Zend_Service_Ebay_Finding_OnlineTest extends PHPUnit_Framework_TestCase
         foreach ($services as $service => $params) {
             $response = call_user_func_array(array($this->_finding, $service), $params);
             $this->assertTrue($response instanceof Zend_Service_Ebay_Finding_Response_Items);
-            if (!$item && $response->searchResult_count > 0) {
+            if (!$item && $response->attributes('searchResult', 'count') > 0) {
                 $item = $response->searchResult->item->current();
             }
-            if (!$category && $response->searchResult_count > 0) {
+            if (!$category && $response->attributes('searchResult', 'count') > 0) {
                 foreach ($response->searchResult->item as $node) {
                     if ($node->primaryCategory) {
                         $category = $node->primaryCategory;
                     }
                 }
             }
-            if (!$store && $response->searchResult_count > 0) {
+            if (!$store && $response->attributes('searchResult', 'count') > 0) {
                 foreach ($response->searchResult->item as $node) {
                     if ($node->storeInfo) {
                         $store = $node->storeInfo;