コード例 #1
0
ファイル: QuotaTest.php プロジェクト: omusico/sugar_work
 public function testNormalQuotaShouldHaveNoExtensionElements()
 {
     $this->quota->limit = "123456789";
     $this->assertEquals("123456789", $this->quota->limit);
     $this->assertEquals(0, count($this->quota->extensionElements));
     $newQuota = new Zend_Gdata_Gapps_Extension_Quota();
     $newQuota->transferFromXML($this->quota->saveXML());
     $this->assertEquals(0, count($newQuota->extensionElements));
     $newQuota->extensionElements = array(new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(1, count($newQuota->extensionElements));
     $this->assertEquals("123456789", $newQuota->limit);
     /* try constructing using magic factory */
     $gdata = new Zend_Gdata_Gapps();
     $newQuota2 = $gdata->newQuota();
     $newQuota2->transferFromXML($newQuota->saveXML());
     $this->assertEquals(1, count($newQuota2->extensionElements));
     $this->assertEquals("123456789", $newQuota2->limit);
 }