[ZF-10089] Zend_Log
[zend.git] / tests / Zend / Gdata / Spreadsheets / SpreadsheetFeedTest.php
blob9031e35be4023155d2da92b20771352aaac80b6b
1 <?php
2 /**
3 * Zend Framework
5 * LICENSE
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.
15 * @category Zend
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
20 * @version $Id $
23 require_once 'Zend/Gdata/Spreadsheets.php';
24 require_once 'Zend/Http/Client.php';
26 /**
27 * @category Zend
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
32 * @group Zend_Gdata
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'),
42 true);
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);