06.10
php
saved
gwoo
Note
gwoo did not leave a note
gwoo did not leave a note
- <?php
- /* SVN FILE: $Id$ */
- /* Ohloh Test cases generated on: 2008-06-07 18:06:54 : 1212887334*/
- App::import('Component', 'Ohloh');
- class TestOhloh extends OhlohComponent {
- }
- class OhlohComponentTest extends CakeTestCase {
- function start() {
- parent::start();
- $this->Ohloh = new TestOhloh();
- }
- function testOhlohInstance() {
- }
- function testProject() {
- $result = $this->Ohloh->Project('cakephp');
- $this->assertEqual($result['Project']['id'], '3176');
- $this->assertEqual($result['Project']['name'], 'CakePHP');
- $this->assertEqual($result['Project']['id'], '3176');
- $this->assertEqual($result['Project']['name'], 'CakePHP');
- }
- }
- ?>
- <?php
- /**
- * Ohloh Api Access
- *
- * @package default
- * @author gwoo
- **/
- class OhlohComponent extends Overloadable {
- 'Account' => '/accounts/{account_id}.xml',
- 'AccountByHash' => '/accounts/{email_md5_hash}.xml',
- 'Accounts' => '/accounts.xml',
- 'ActivityFacts' => '/projects/{project_id}/analyses/{analysis_id}/activity_facts.xml',
- 'ActivityLatest' => '/projects/{project_id}/analyses/latest/activity_facts.xml',
- 'ContributorFact' => "/projects/{project_id}/contributors/{contributor_id}.xml",
- 'ContributorFacts' => "/projects/{project_id}/contributors.xml",
- 'ContributorLanguageFacts' => '/projects/{project_id}/contributors/{contributor_id}.xml',
- 'Enlistment' => '/projects/{project_id}/enlistment/{enlistment_id}.xml',
- 'Enlistments' => '/projects/{project_id}/enlistment/{enlistment_id}.xml',
- 'Factoid' => '/projects/{project_id}/factoids/{factoid_id}.xml',
- 'Factoids' => '/projects/{project_id}/factoids.xml',
- 'KudosReceived' => '/accounts/{account_id}/kudos.xml',
- 'KudosSent' => '/accounts/{account_id}/kudos/sent.xml',
- 'Language' => '/languages/{language_id}.xml',
- 'Languages' => '/languages.xml',
- 'Project' => '/projects/{project_id}.xml',
- 'Projects' => '/projects.xml',
- 'SizeFacts' => '/projects/{project_id}/analyses/{analysis_id}/size_facts.xml',
- 'SizeFactsLatest' => '/projects/{project_id}/analyses/latest/size_facts.xml',
- 'StackByAccount' => '/accounts/{account_id}/stacks/{stack_id}.xml',
- 'StackByAccountDefault' => '/accounts/{account_id}/stacks/default.xml',
- 'Stacks' => '/projects/{project_id}/stacks.xml'
- );
- /**
- * call the svn method
- *
- *
- */
- function call__($method, $params) {
- $data = null;
- $Http = new HttpSocket();
- $uri = null;
- $params = $params[0];
- }
- trigger_error("wrong parameter count for {$method}. expecting " . count($matches[1]), E_USER_ERROR);
- return false;
- }
- foreach ($matches[1] as $key => $match) {
- } else {
- return false;
- }
- }
- $data = Set::reverse(new Xml($result));
- return $data['Response']['Result'];
- return $data['Response']['Error'];
- }
- }
- }
- return false;
- }
- /**
- * sets or returns config
- *
- */
- return $this->config;
- }
- }
- /**
- * callbacks that need to be overriden for call__
- *
- */
- function initialize(&$controller) {}
- function startup(&$controller) {}
- function beforeRender() {}
- function beforeRedirect() {}
- function shutdown() {}
- }
Parsed in 0.260 seconds, using GeSHi 1.0.7.14