7 * This source file is subject to the new BSD license that is bundled
8 * with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
16 * @package Zend_Gdata_Spreadsheets
17 * @subpackage UnitTests
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
23 require_once 'Zend/Gdata/Spreadsheets.php';
24 require_once 'Zend/Http/Client.php';
28 * @package Zend_Gdata_Spreadsheets
29 * @subpackage UnitTests
30 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
31 * @license http://framework.zend.com/license/new-bsd New BSD License
33 * @group Zend_Gdata_Spreadsheets
35 class Zend_Gdata_Spreadsheets_SpreadsheetFeedTest
extends PHPUnit_Framework_TestCase
38 public function setUp()
40 $this->sprFeed
= new Zend_Gdata_Spreadsheets_SpreadsheetFeed(
41 file_get_contents(dirname(__FILE__
) . '/_files/TestDataSpreadsheetFeedSample1.xml'),
45 public function testToAndFromString()
47 $this->assertTrue(count($this->sprFeed
->entries
) == 1);
48 foreach($this->sprFeed
->entries
as $entry)
50 $this->assertTrue($entry instanceof Zend_Gdata_Spreadsheets_SpreadsheetEntry
);
53 $newSprFeed = new Zend_Gdata_Spreadsheets_SpreadsheetFeed();
54 $doc = new DOMDocument();
55 $doc->loadXML($this->sprFeed
->saveXML());
56 $newSprFeed->transferFromDom($doc->documentElement
);
58 $this->assertTrue(count($newSprFeed->entries
) == 1);
59 foreach($newSprFeed->entries
as $entry)
61 $this->assertTrue($entry instanceof Zend_Gdata_Spreadsheets_SpreadsheetEntry
);