コード例 #1
0
ファイル: HealthOnlineTest.php プロジェクト: alab1001101/zf2
 public function testSendNoticeWithoutCcrUsingDirectInsert()
 {
     $this->setupProfileID();
     $profileID = $this->health->getProfileID();
     $subject = "Title of your notice goes here";
     $body = "Notice body goes here";
     $entry = new Health\ProfileEntry();
     $author = $this->health->newAuthor();
     $author->name = $this->health->newName('John Doe');
     $author->email = $this->health->newEmail('*****@*****.**');
     $entry->setAuthor(array(0 => $author));
     $entry->title = $this->health->newTitle($subject);
     $entry->content = $this->health->newContent($body);
     $entry->content->type = 'text';
     $ccrXML = file_get_contents('Zend/GData/Health/_files/ccr_notice_sample.xml', true);
     $entry->setCcr($ccrXML);
     $uri = "https://www.google.com/health/feeds/register/ui/{$profileID}";
     $responseEntry = $this->health->insertEntry($entry, $uri, '\\Zend\\GData\\Health\\ProfileEntry');
     $this->assertTrue($responseEntry instanceof Health\ProfileEntry);
     $this->assertEquals($subject, $responseEntry->title->text);
     $this->assertEquals($author->name->text, 'John Doe');
     $this->assertEquals($author->email->text, '*****@*****.**');
     $this->assertEquals($body, $responseEntry->content->text);
 }