View Source

<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>

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

<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>
<li>TESTS_ZEND_GDATA_CLIENTLOGIN_PASSWORD =&gt; 'your_password_goes_here'</li>

<p>Next, log into <a href="">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>

<ac:macro ac:name="noformat"><ac:plain-text-body><![CDATA[]]></ac:plain-text-body></ac:macro>

<p>This last number is your blog ID. Add this to your configuration:</p>
<li>TESTS_ZEND_GDATA_BLOG_ID =&gt; '1111111111111111111'</li>

<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>

<p>Log into <a href="">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>

<ac:macro ac:name="noformat"><ac:plain-text-body><![CDATA[var TX_id = "o11111111111111111111.2222222222222222222.3333333333333333333.4444444444444444444";]]></ac:plain-text-body></ac:macro>

<p>The first two sets of numbers (separated by periods/full stops) constitute the spreadsheet's key. Enter this into the test configuration:</p>
<li>TESTS_ZEND_GDATA_SPREADSHEETS_SPREADSHEETKEY =&gt; o11111111111111111111.2222222222222222222</li>

<p>TESTS_ZEND_GDATA_SPREADSHEETS_WORKSHEETID can be left set to 'default'.</p>

<h2>Google Apps</h2>
<p>The Google Apps test suite needs to know a domain which can be modified for testing:</p>
<li>TESTS_ZEND_GDATA_GAPPS_DOMAIN =&gt; 'your-domain.tld'</li>

<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>

<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>
<li>TESTS_ZEND_GDATA_GAPPS_EMAIL =&gt; 'you@your-domain.tld'</li>
<li>TESTS_ZEND_GDATA_GAPPS_PASSWORD =&gt; 'your_password_goes_here'</li>

<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>

<p>The tests for Calendar, Base, Docs, and Photos do not need any special configuration, simply enable them as desired:</p>

<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>