compared with
Current by Trevor Johns
on Jan 14, 2008 08:46.

(show comment)
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (40)

View Page History
<p>Zend_Gdata is a client library to interact with Google's APIs using the Google data protocol. This document contains information for Zend Framework developers about maintaining this module, including design decisions, development tips, and directions for future work.</p>

<p>This information is not intended to replace information available in the issue tracker, manual, or API guide.</p>

h1. Architecture
(+) Needs to be written!
<h1>Architecture</h1>
<p><ac:emoticon ac:name="plus" /> Needs to be written!</p>

h1. Unit Test Configuration
h2. General Configuration
<h1>Unit Test Configuration</h1>
<h2>General Configuration</h2>
<p>In order to enable the online unit tests for Zend_Gdata, you will first want to obtain a Google account which you can use for testing purposes. Once that's done, make the following changes to tests/TestConfiguration.php:</p>
* TESTS_ZEND_GDATA_ONLINE_ENABLED => true
* TESTS_ZEND_GDATA_CLIENTLOGIN_ENABLED => true
* TESTS_ZEND_GDATA_CLIENTLOGIN_EMAIL => 'you@gmail.com'
* TESTS_ZEND_GDATA_CLIENTLOGIN_PASSWORD => 'your_password_goes_here'
<ul>
<li>TESTS_ZEND_GDATA_ONLINE_ENABLED =&gt; true</li>
<li>TESTS_ZEND_GDATA_CLIENTLOGIN_ENABLED =&gt; true</li>
<li>TESTS_ZEND_GDATA_CLIENTLOGIN_EMAIL =&gt; 'you@gmail.com'</li>
<li>TESTS_ZEND_GDATA_CLIENTLOGIN_PASSWORD =&gt; 'your_password_goes_here'</li>
</ul>

h2. Blogger
Next, log into [Blogger|http://www.blogger.com] with your username and password and create a new blog. It will be publicly visible, so be careful what you name it. Once that's done, go to the *Manage Posts* menu. Notice that this menu has a URL of the form:

{noformat}http://www.blogger.com/posts.g?blogID=1111111111111111111{noformat} <h2>Blogger</h2>
<p>Next, log into <a href="http://www.blogger.com">Blogger</a> with your username and password and create a new blog. It will be publicly visible, so be careful what you name it. Once that's done, go to the <strong>Manage Posts</strong> menu. Notice that this menu has a URL of the form:</p>

This last number is your blog ID. Add this to your configuration:
* TESTS_ZEND_GDATA_BLOGGER_ONLINE_ENABLED => true
* TESTS_ZEND_GDATA_BLOG_ID => '1111111111111111111'
<ac:macro ac:name="noformat"><ac:plain-text-body><![CDATA[http://www.blogger.com/posts.g?blogID=1111111111111111111]]></ac:plain-text-body></ac:macro>

Note that if the unit tests are run too frequently, Blogger will begin to treat posts to this blog via the API as spam, causing the tests to fail. If this happens, you will need to delete your blog and recreate it, generating a new blog ID.
<p>This last number is your blog ID. Add this to your configuration:</p>
<ul>
<li>TESTS_ZEND_GDATA_BLOGGER_ONLINE_ENABLED =&gt; true</li>
<li>TESTS_ZEND_GDATA_BLOG_ID =&gt; '1111111111111111111'</li>
</ul>

h2. Spreadsheets
Log into [Google Docs|http://docs.google.com] and create a new spreadsheet, making sure that it has a name and is saved. View the spreadsheet's source in your browser and search for the line that looks like this:

{noformat}var TX_id = "o11111111111111111111.2222222222222222222.3333333333333333333.4444444444444444444";{noformat}
<p>Note that if the unit tests are run too frequently, Blogger will begin to treat posts to this blog via the API as spam, causing the tests to fail. If this happens, you will need to delete your blog and recreate it, generating a new blog ID.</p>

The first two sets of numbers (separated by periods/full stops) constitute the spreadsheet's key. Enter this into the test configuration:
* TESTS_ZEND_GDATA_SPREADSHEETS_ONLINE_ENABLED => true
* TESTS_ZEND_GDATA_SPREADSHEETS_SPREADSHEETKEY => o11111111111111111111.2222222222222222222
<h2>Spreadsheets</h2>
<p>Log into <a href="http://docs.google.com">Google Docs</a> and create a new spreadsheet, making sure that it has a name and is saved. View the spreadsheet's source in your browser and search for the line that looks like this:</p>

TESTS_ZEND_GDATA_SPREADSHEETS_WORKSHEETID can be left set to 'default'.
<ac:macro ac:name="noformat"><ac:plain-text-body><![CDATA[var TX_id = "o11111111111111111111.2222222222222222222.3333333333333333333.4444444444444444444";]]></ac:plain-text-body></ac:macro>

h2. Google Apps
The Google Apps test suite needs to know a domain which can be modified for testing:
* TESTS_ZEND_GDATA_GAPPS_ONLINE_ENABLED => true
* TESTS_ZEND_GDATA_GAPPS_DOMAIN => 'your-domain.tld'
<p>The first two sets of numbers (separated by periods/full stops) constitute the spreadsheet's key. Enter this into the test configuration:</p>
<ul>
<li>TESTS_ZEND_GDATA_SPREADSHEETS_ONLINE_ENABLED =&gt; true</li>
<li>TESTS_ZEND_GDATA_SPREADSHEETS_SPREADSHEETKEY =&gt; o11111111111111111111.2222222222222222222</li>
</ul>

(!) *Be aware that this test will create several hundred users. Do not enable this test unless you are willing to take responsibility for any charges associated with this!*

The Google Apps test suite uses a separate username and password from that stored in TESTS_ZEND_GDATA_CLIENTLOGIN_EMAIL and TESTS_ZEND_GDATA_CLIENTLOGIN_PASSWORD, since a Google Apps administrator account is may not always be associated with other Google services:
* TESTS_ZEND_GDATA_GAPPS_EMAIL => 'you@your-domain.tld'
* TESTS_ZEND_GDATA_GAPPS_PASSWORD => 'your_password_goes_here'
<p>TESTS_ZEND_GDATA_SPREADSHEETS_WORKSHEETID can be left set to 'default'.</p>

h2. YouTube
The YouTube API needs to know the name of a valid YouTube user for certain tests as TESTS_ZEND_GDATA_YOUTUBE_ACCOUNT. Since no modifications are made to this account, you can leave it set to it's default value of 'zfgdata' unless there is a particular set of data you wish to test against. Other than this, just make sure this test is enabled.
* TESTS_ZEND_GDATA_YOUTUBE_ONLINE_ENABLED => true
<h2>Google Apps</h2>
<p>The Google Apps test suite needs to know a domain which can be modified for testing:</p>
<ul>
<li>TESTS_ZEND_GDATA_GAPPS_ONLINE_ENABLED =&gt; true</li>
<li>TESTS_ZEND_GDATA_GAPPS_DOMAIN =&gt; 'your-domain.tld'</li>
</ul>

h2. Others
The tests for Calendar, Base, Docs, and Photos do not need any special configuration, simply enable them as desired:
* TESTS_ZEND_GDATA_CALENDAR_ONLINE_ENABLED => true
* TESTS_ZEND_GDATA_GBASE_ONLINE_ENABLED => true
* TESTS_ZEND_GDATA_DOCS_ONLINE_ENABLED => true
* TESTS_ZEND_GDATA_PHOTOS_ONLINE_ENABLED => true

h1. Common Issues
h2. Time Zone Not Set
If you receive the following error while truing to run the Zend_Gdata test suite:
<p><ac:emoticon ac:name="warning" /> <strong>Be aware that this test will create several hundred users. Do not enable this test unless you are willing to take responsibility for any charges associated with this!</strong></p>

{{monspaced}}strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PST/-8.0/no DST' instead{{monspaced}}
<p>The Google Apps test suite uses a separate username and password from that stored in TESTS_ZEND_GDATA_CLIENTLOGIN_EMAIL and TESTS_ZEND_GDATA_CLIENTLOGIN_PASSWORD, since a Google Apps administrator account is may not always be associated with other Google services:</p>
<ul>
<li>TESTS_ZEND_GDATA_GAPPS_EMAIL =&gt; 'you@your-domain.tld'</li>
<li>TESTS_ZEND_GDATA_GAPPS_PASSWORD =&gt; 'your_password_goes_here'</li>
</ul>

then your timezone is not set. To resolve this, edit your php.ini and set the date.timezone property:

{noformat}date.timezone = America/Los_Angeles{noformat}
<h2>YouTube</h2>
<p>The YouTube API needs to know the name of a valid YouTube user for certain tests as TESTS_ZEND_GDATA_YOUTUBE_ACCOUNT. Since no modifications are made to this account, you can leave it set to it's default value of 'zfgdata' unless there is a particular set of data you wish to test against. Other than this, just make sure this test is enabled.</p>
<ul>
<li>TESTS_ZEND_GDATA_YOUTUBE_ONLINE_ENABLED =&gt; true</li>
</ul>

h1. Future Work
(+) Needs to be written!

<h2>Others</h2>
<p>The tests for Calendar, Base, Docs, and Photos do not need any special configuration, simply enable them as desired:</p>
<ul>
<li>TESTS_ZEND_GDATA_CALENDAR_ONLINE_ENABLED =&gt; true</li>
<li>TESTS_ZEND_GDATA_GBASE_ONLINE_ENABLED =&gt; true</li>
<li>TESTS_ZEND_GDATA_DOCS_ONLINE_ENABLED =&gt; true</li>
<li>TESTS_ZEND_GDATA_PHOTOS_ONLINE_ENABLED =&gt; true</li>
</ul>


<h1>Common Issues</h1>
<h2>Time Zone Not Set</h2>
<p>If you receive the following error while truing to run the Zend_Gdata test suite:</p>

<p><code>monspaced}}strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PST/-8.0/no DST' instead{{monspaced</code></p>

<p>then your timezone is not set. To resolve this, edit your php.ini and set the date.timezone property:</p>

<ac:macro ac:name="noformat"><ac:plain-text-body><![CDATA[date.timezone = America/Los_Angeles]]></ac:plain-text-body></ac:macro>

<h1>Future Work</h1>
<p><ac:emoticon ac:name="plus" /> Needs to be written!</p>