Skip to end of metadata
Go to start of metadata

<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</h1>
<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>
<ul>
<li>TESTS_ZEND_GDATA_ONLINE_ENABLED => true</li>
<li>TESTS_ZEND_GDATA_CLIENTLOGIN_ENABLED => true</li>
<li>TESTS_ZEND_GDATA_CLIENTLOGIN_EMAIL => 'you@gmail.com'</li>
<li>TESTS_ZEND_GDATA_CLIENTLOGIN_PASSWORD => 'your_password_goes_here'</li>
</ul>

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

<ac:macro ac:name="noformat"><ac:plain-text-body><![CDATAhttp://www.blogger.com/posts.g?blogID=1111111111111111111]></ac:plain-text-body></ac:macro>

<p>This last number is your blog ID. Add this to your configuration:</p>
<ul>
<li>TESTS_ZEND_GDATA_BLOGGER_ONLINE_ENABLED => true</li>
<li>TESTS_ZEND_GDATA_BLOG_ID => '1111111111111111111'</li>
</ul>

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

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

<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>
<ul>
<li>TESTS_ZEND_GDATA_SPREADSHEETS_ONLINE_ENABLED => true</li>
<li>TESTS_ZEND_GDATA_SPREADSHEETS_SPREADSHEETKEY => o11111111111111111111.2222222222222222222</li>
</ul>

<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>
<ul>
<li>TESTS_ZEND_GDATA_GAPPS_ONLINE_ENABLED => true</li>
<li>TESTS_ZEND_GDATA_GAPPS_DOMAIN => 'your-domain.tld'</li>
</ul>

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

<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 => true</li>
</ul>

<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 => true</li>
<li>TESTS_ZEND_GDATA_GBASE_ONLINE_ENABLED => true</li>
<li>TESTS_ZEND_GDATA_DOCS_ONLINE_ENABLED => true</li>
<li>TESTS_ZEND_GDATA_PHOTOS_ONLINE_ENABLED => 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>

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.