Example #1
0
 public function testToAndFromString()
 {
     $this->assertEquals(2, count($this->cellFeed->entries));
     $this->assertEquals(2, $this->cellFeed->entries->count());
     foreach ($this->cellFeed->entries as $entry) {
         $this->assertInstanceOf('Zend\\GData\\Spreadsheets\\CellEntry', $entry);
     }
     $this->assertInstanceOf('Zend\\GData\\Spreadsheets\\Extension\\RowCount', $this->cellFeed->getRowCount());
     $this->assertTrue($this->cellFeed->getRowCount()->getText() == '100');
     $this->assertInstanceOf('Zend\\GData\\Spreadsheets\\Extension\\ColCount', $this->cellFeed->getColumnCount());
     $this->assertTrue($this->cellFeed->getColumnCount()->getText() == '20');
     $newCellFeed = new Spreadsheets\CellFeed();
     $doc = new \DOMDocument();
     $doc->loadXML($this->cellFeed->saveXML());
     $newCellFeed->transferFromDom($doc->documentElement);
     $this->assertEquals(2, count($newCellFeed->entries));
     $this->assertEquals(2, $newCellFeed->entries->count());
     foreach ($newCellFeed->entries as $entry) {
         $this->assertInstanceOf('Zend\\GData\\Spreadsheets\\CellEntry', $entry);
     }
     $this->assertInstanceOf('Zend\\GData\\Spreadsheets\\Extension\\RowCount', $newCellFeed->getRowCount());
     $this->assertTrue($newCellFeed->getRowCount()->getText() == '100');
     $this->assertInstanceOf('Zend\\GData\\Spreadsheets\\Extension\\ColCount', $newCellFeed->getColumnCount());
     $this->assertTrue($newCellFeed->getColumnCount()->getText() == '20');
 }
Example #2
0
    public function testToAndFromString()
    {
        $this->assertTrue(count($this->cellFeed->entries) == 1);
        foreach($this->cellFeed->entries as $entry)
        {
            $this->assertTrue($entry instanceof Spreadsheets\CellEntry);
        }
        $this->assertTrue($this->cellFeed->getRowCount() instanceof Extension\RowCount);
        $this->assertTrue($this->cellFeed->getRowCount()->getText() == '100');
        $this->assertTrue($this->cellFeed->getColumnCount() instanceof Extension\ColCount);
        $this->assertTrue($this->cellFeed->getColumnCount()->getText() == '20');

        $newCellFeed = new Spreadsheets\CellFeed();
        $doc = new \DOMDocument();
        $doc->loadXML($this->cellFeed->saveXML());
        $newCellFeed->transferFromDom($doc->documentElement);

        $this->assertTrue(count($newCellFeed->entries) == 1);
        foreach($newCellFeed->entries as $entry)
        {
            $this->assertTrue($entry instanceof Spreadsheets\CellEntry);
        }
        $this->assertTrue($newCellFeed->getRowCount() instanceof Extension\RowCount);
        $this->assertTrue($newCellFeed->getRowCount()->getText() == '100');
        $this->assertTrue($newCellFeed->getColumnCount() instanceof Extension\ColCount);
        $this->assertTrue($newCellFeed->getColumnCount()->getText() == '20');
    }