Modified: incubator/shindig/trunk/php/test/social/InputXmlConverterTest.php URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/test/social/InputXmlConverterTest.php?rev=719967&r1=719966&r2=719967&view=diff ============================================================================== --- incubator/shindig/trunk/php/test/social/InputXmlConverterTest.php (original) +++ incubator/shindig/trunk/php/test/social/InputXmlConverterTest.php Sun Nov 23 01:17:03 2008 @@ -1,56 +1,54 @@ <?php -/* +/** * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ /** * InputXmlConverter test case. */ class InputXmlConverterTest extends PHPUnit_Framework_TestCase { - - /** - * @var InputXmlConverter - */ - private $InputXmlConverter; - - /** - * Prepares the environment before running a test. - */ - protected function setUp() - { - parent::setUp(); - $this->InputXmlConverter = new InputXmlConverter(/* parameters */); - } - - /** - * Cleans up the environment after running a test. - */ - protected function tearDown() - { - $this->InputXmlConverter = null; - parent::tearDown(); - } - - /** - * Tests InputXmlConverter->convertActivities() - */ - public function testConvertActivities() - { - $xml = '<?xml version="1.0" encoding="UTF-8"?> + + /** + * @var InputXmlConverter + */ + private $InputXmlConverter; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() { + parent::setUp(); + $this->InputXmlConverter = new InputXmlConverter(/* parameters */); + } + + /** + * Cleans up the environment after running a test. + */ + protected function tearDown() { + $this->InputXmlConverter = null; + parent::tearDown(); + } + + /** + * Tests InputXmlConverter->convertActivities() + */ + public function testConvertActivities() { + $xml = '<?xml version="1.0" encoding="UTF-8"?> <response> <activity xmlns="http://ns.opensocial.org/2008/opensocial"> <mediaItems> @@ -76,41 +74,39 @@ <summary>example summary</summary> </response> '; - $activity = $this->InputXmlConverter->convertActivities($xml); - $this->assertEquals('urn:guid:220', $activity['id']); - $this->assertEquals('example title', $activity['title']); - $this->assertEquals('example summary', $activity['body']); - $this->assertEquals('1', $activity['streamId']); - $this->assertEquals('activities', $activity['streamTitle']); - $this->assertEquals('2008-08-05T10:31:04+02:00', $activity['updated']); - $this->assertEquals('image', $activity['mediaItems'][0]['type']); - $this->assertEquals('IMAGE', $activity['mediaItems'][0]['mimeType']); - $this->assertEquals('http://cdn.davesdaily.com/pictures/784-awesome-hands.jpg', $activity['mediaItems'][0]['url']); - } - - /** - * Tests InputXmlConverter->convertAppData() - */ - public function testConvertAppData() - { - $xml = '<?xml version="1.0" encoding="UTF-8"?> + $activity = $this->InputXmlConverter->convertActivities($xml); + $this->assertEquals('urn:guid:220', $activity['id']); + $this->assertEquals('example title', $activity['title']); + $this->assertEquals('example summary', $activity['body']); + $this->assertEquals('1', $activity['streamId']); + $this->assertEquals('activities', $activity['streamTitle']); + $this->assertEquals('2008-08-05T10:31:04+02:00', $activity['updated']); + $this->assertEquals('image', $activity['mediaItems'][0]['type']); + $this->assertEquals('IMAGE', $activity['mediaItems'][0]['mimeType']); + $this->assertEquals('http://cdn.davesdaily.com/pictures/784-awesome-hands.jpg', $activity['mediaItems'][0]['url']); + } + + /** + * Tests InputXmlConverter->convertAppData() + */ + public function testConvertAppData() { + $xml = '<?xml version="1.0" encoding="UTF-8"?> <response> <entry> <key>sign</key> <value>Virgo</value> </entry> </response>'; - $appdata = $this->InputXmlConverter->convertAppData($xml); - $expect = array('sign' => 'Virgo'); - $this->assertEquals($expect, $appdata); - } - - /** - * Tests InputXmlConverter->convertMessages() - */ - public function testConvertMessages() - { - $xml = '<?xml version="1.0" encoding="UTF-8"?> + $appdata = $this->InputXmlConverter->convertAppData($xml); + $expect = array('sign' => 'Virgo'); + $this->assertEquals($expect, $appdata); + } + + /** + * Tests InputXmlConverter->convertMessages() + */ + public function testConvertMessages() { + $xml = '<?xml version="1.0" encoding="UTF-8"?> <response xmlns:osapi="http://opensocial.org/2008/opensocialapi"> <osapi:recipient>example.org:AD38B3886625AAF</osapi:recipient> <osapi:recipient>example.org:997638BAA6F25AD</osapi:recipient> @@ -118,20 +114,19 @@ <id>{msgid}</id> <body>Click <a href="http://app.example.org/invites/{msgid}">here</a> to review your invitation.</body> </response>'; - $message = $this->InputXmlConverter->convertMessages($xml); - $this->assertEquals('{msgid}', $message['id']); - $this->assertEquals('You have an invitation from Joe', $message['title']); - $this->assertEquals('Click <a href="http://app.example.org/invites/{msgid}">here</a> to review your invitation.', $message['body']); - $this->assertEquals('example.org:AD38B3886625AAF', $message['recipients'][0]); - $this->assertEquals('example.org:997638BAA6F25AD', $message['recipients'][1]); - } - - /** - * Tests InputXmlConverter->convertPeople() - */ - public function testConvertPeople() - { - $this->setExpectedException(Exception); - $this->InputXmlConverter->convertPeople(''); - } + $message = $this->InputXmlConverter->convertMessages($xml); + $this->assertEquals('{msgid}', $message['id']); + $this->assertEquals('You have an invitation from Joe', $message['title']); + $this->assertEquals('Click <a href="http://app.example.org/invites/{msgid}">here</a> to review your invitation.', $message['body']); + $this->assertEquals('example.org:AD38B3886625AAF', $message['recipients'][0]); + $this->assertEquals('example.org:997638BAA6F25AD', $message['recipients'][1]); + } + + /** + * Tests InputXmlConverter->convertPeople() + */ + public function testConvertPeople() { + $this->setExpectedException(Exception); + $this->InputXmlConverter->convertPeople(''); + } } \ No newline at end of file
Modified: incubator/shindig/trunk/php/test/social/MediaItemTest.php URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/test/social/MediaItemTest.php?rev=719967&r1=719966&r2=719967&view=diff ============================================================================== --- incubator/shindig/trunk/php/test/social/MediaItemTest.php (original) +++ incubator/shindig/trunk/php/test/social/MediaItemTest.php Sun Nov 23 01:17:03 2008 @@ -1,98 +1,91 @@ <?php -/* +/** * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ /** * MediaItem test case. */ class MediaItemTest extends PHPUnit_Framework_TestCase { - - /** - * @var MediaItem - */ - private $MediaItem; - - /** - * Prepares the environment before running a test. - */ - protected function setUp() - { - parent::setUp(); - $this->MediaItem = new MediaItem('MIMETYPE', 'AUDIO', 'URL'); - } - - /** - * Cleans up the environment after running a test. - */ - protected function tearDown() - { - $this->MediaItem = null; - parent::tearDown(); - } - - /** - * Tests MediaItem->getMimeType() - */ - public function testGetMimeType() - { - $this->assertEquals('MIMETYPE', $this->MediaItem->getMimeType()); - } - - /** - * Tests MediaItem->getType() - */ - public function testGetType() - { - $this->assertEquals('audio', $this->MediaItem->getType()); - } - - /** - * Tests MediaItem->getUrl() - */ - public function testGetUrl() - { - $this->assertEquals('URL', $this->MediaItem->getUrl()); - } - - /** - * Tests MediaItem->setMimeType() - */ - public function testSetMimeType() - { - $this->MediaItem->setMimeType('mimetype'); - $this->assertEquals('mimetype', $this->MediaItem->mimeType); - } - - /** - * Tests MediaItem->setType() - */ - public function testSetType() - { - $this->MediaItem->setType('VIDEO'); - $this->assertEquals('video', $this->MediaItem->type); - } - - /** - * Tests MediaItem->setUrl() - */ - public function testSetUrl() - { - $this->MediaItem->setUrl('url'); - $this->assertEquals('url', $this->MediaItem->url); - } + + /** + * @var MediaItem + */ + private $MediaItem; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() { + parent::setUp(); + $this->MediaItem = new MediaItem('MIMETYPE', 'AUDIO', 'URL'); + } + + /** + * Cleans up the environment after running a test. + */ + protected function tearDown() { + $this->MediaItem = null; + parent::tearDown(); + } + + /** + * Tests MediaItem->getMimeType() + */ + public function testGetMimeType() { + $this->assertEquals('MIMETYPE', $this->MediaItem->getMimeType()); + } + + /** + * Tests MediaItem->getType() + */ + public function testGetType() { + $this->assertEquals('audio', $this->MediaItem->getType()); + } + + /** + * Tests MediaItem->getUrl() + */ + public function testGetUrl() { + $this->assertEquals('URL', $this->MediaItem->getUrl()); + } + + /** + * Tests MediaItem->setMimeType() + */ + public function testSetMimeType() { + $this->MediaItem->setMimeType('mimetype'); + $this->assertEquals('mimetype', $this->MediaItem->mimeType); + } + + /** + * Tests MediaItem->setType() + */ + public function testSetType() { + $this->MediaItem->setType('VIDEO'); + $this->assertEquals('video', $this->MediaItem->type); + } + + /** + * Tests MediaItem->setUrl() + */ + public function testSetUrl() { + $this->MediaItem->setUrl('url'); + $this->assertEquals('url', $this->MediaItem->url); + } } Modified: incubator/shindig/trunk/php/test/social/MessageTest.php URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/test/social/MessageTest.php?rev=719967&r1=719966&r2=719967&view=diff ============================================================================== --- incubator/shindig/trunk/php/test/social/MessageTest.php (original) +++ incubator/shindig/trunk/php/test/social/MessageTest.php Sun Nov 23 01:17:03 2008 @@ -1,106 +1,98 @@ <?php -/* +/** * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ /** * Message test case. */ class MessageTest extends PHPUnit_Framework_TestCase { - - /** - * @var Message - */ - private $Message; - - /** - * Prepares the environment before running a test. - */ - protected function setUp() - { - parent::setUp(); - $this->Message = new Message('BODY', 'TITLE', 'NOTIFICATION'); - } - - /** - * Cleans up the environment after running a test. - */ - protected function tearDown() - { - $this->Message = null; - parent::tearDown(); - } - - /** - * Tests Message->getBody() - */ - public function testGetBody() - { - $this->assertEquals('BODY', $this->Message->getBody()); - } - - /** - * Tests Message->getTitle() - */ - public function testGetTitle() - { - $this->assertEquals('TITLE', $this->Message->getTitle()); - } - - /** - * Tests Message->getType() - */ - public function testGetType() - { - $this->assertEquals('NOTIFICATION', $this->Message->getType()); - } - - /** - * Tests Message->sanitizeHTML() - */ - public function testSanitizeHTML() - { - $this->assertEquals('ABC', $this->Message->sanitizeHTML('ABC')); - } - - /** - * Tests Message->setBody() - */ - public function testSetBody() - { - $this->Message->setBody('body'); - $this->assertEquals('body', $this->Message->body); - } - - /** - * Tests Message->setTitle() - */ - public function testSetTitle() - { - $this->Message->setTitle('title'); - $this->assertEquals('title', $this->Message->title); - } - - /** - * Tests Message->setType() - */ - public function testSetType() - { - $this->Message->setType('EMAIL'); - $this->assertEquals('EMAIL', $this->Message->type); - } + + /** + * @var Message + */ + private $Message; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() { + parent::setUp(); + $this->Message = new Message('BODY', 'TITLE', 'NOTIFICATION'); + } + + /** + * Cleans up the environment after running a test. + */ + protected function tearDown() { + $this->Message = null; + parent::tearDown(); + } + + /** + * Tests Message->getBody() + */ + public function testGetBody() { + $this->assertEquals('BODY', $this->Message->getBody()); + } + + /** + * Tests Message->getTitle() + */ + public function testGetTitle() { + $this->assertEquals('TITLE', $this->Message->getTitle()); + } + + /** + * Tests Message->getType() + */ + public function testGetType() { + $this->assertEquals('NOTIFICATION', $this->Message->getType()); + } + + /** + * Tests Message->sanitizeHTML() + */ + public function testSanitizeHTML() { + $this->assertEquals('ABC', $this->Message->sanitizeHTML('ABC')); + } + + /** + * Tests Message->setBody() + */ + public function testSetBody() { + $this->Message->setBody('body'); + $this->assertEquals('body', $this->Message->body); + } + + /** + * Tests Message->setTitle() + */ + public function testSetTitle() { + $this->Message->setTitle('title'); + $this->assertEquals('title', $this->Message->title); + } + + /** + * Tests Message->setType() + */ + public function testSetType() { + $this->Message->setType('EMAIL'); + $this->assertEquals('EMAIL', $this->Message->type); + } } Modified: incubator/shindig/trunk/php/test/social/NameTest.php URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/test/social/NameTest.php?rev=719967&r1=719966&r2=719967&view=diff ============================================================================== --- incubator/shindig/trunk/php/test/social/NameTest.php (original) +++ incubator/shindig/trunk/php/test/social/NameTest.php Sun Nov 23 01:17:03 2008 @@ -1,188 +1,175 @@ <?php -/* +/** * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ /** * Name test case. */ class NameTest extends PHPUnit_Framework_TestCase { - - /** - * @var Name - */ - private $Name; - - /** - * @var additionalName - */ - public $additionalName; - - /** - * @var familyName - */ - public $familyName; - - /** - * @var givenName - */ - public $givenName; - - /** - * @var honorificPrefix - */ - public $honorificPrefix; - - /** - * @var honorificSuffix - */ - public $honorificSuffix; - - /** - * @var unstructured - */ - public $unstructured = ''; - - /** - * Prepares the environment before running a test. - */ - protected function setUp() - { - parent::setUp(); - $this->Name = new Name($this->unstructured); - - } - - /** - * Cleans up the environment after running a test. - */ - protected function tearDown() - { - $this->Name = null; - - parent::tearDown(); - } - - /** - * Tests Name->getAdditionalName() - */ - public function testGetAdditionalName() - { - $this->Name->additionalName = $this->additionalName; - $this->assertEquals($this->Name->getAdditionalName(), $this->additionalName); - } - - /** - * Tests Name->getFamilyName() - */ - public function testGetFamilyName() - { - $this->Name->familyName = $this->familyName; - $this->assertEquals($this->Name->getFamilyName(), $this->familyName); - } - - /** - * Tests Name->getGivenName() - */ - public function testGetGivenName() - { - $this->Name->givenName = $this->givenName; - $this->assertEquals($this->Name->getGivenName(), $this->givenName); - } - - /** - * Tests Name->getHonorificPrefix() - */ - public function testGetHonorificPrefix() - { - $this->Name->honorificPrefix = $this->honorificPrefix; - $this->assertEquals($this->Name->getHonorificPrefix(), $this->honorificPrefix); - } - - /** - * Tests Name->getHonorificSuffix() - */ - public function testGetHonorificSuffix() - { - $this->Name->honorificSuffix = $this->honorificSuffix; - $this->assertEquals($this->Name->getHonorificSuffix(), $this->honorificSuffix); - } - - /** - * Tests Name->getUnstructured() - */ - public function testGetUnstructured() - { - $this->Name->unstructured = $this->unstructured; - $this->assertEquals($this->Name->getFormatted(), $this->unstructured); - } - - /** - * Tests Name->setAdditionalName() - */ - public function testSetAdditionalName() - { - $this->Name->setAdditionalName($this->additionalName); - $this->assertEquals($this->Name->getAdditionalName(), $this->additionalName); - } - - /** - * Tests Name->setFamilyName() - */ - public function testSetFamilyName() - { - $this->Name->setFamilyName($this->familyName); - $this->assertEquals($this->Name->getFamilyName(), $this->familyName); - } - - /** - * Tests Name->setGivenName() - */ - public function testSetGivenName() - { - $this->Name->setGivenName($this->givenName); - $this->assertEquals($this->Name->getGivenName(), $this->givenName); - } - - /** - * Tests Name->setHonorificPrefix() - */ - public function testSetHonorificPrefix() - { - $this->Name->setHonorificPrefix($this->honorificPrefix); - $this->assertEquals($this->Name->getHonorificPrefix(), $this->honorificPrefix); - - } - - /** - * Tests Name->setHonorificSuffix() - */ - public function testSetHonorificSuffix() - { - $this->Name->setHonorificSuffix($this->honorificSuffix); - $this->assertEquals($this->Name->getHonorificSuffix(), $this->honorificSuffix); - } - - /** - * Tests Name->setUnstructured() - */ - public function testSetUnstructured() - { - $this->Name->setFormatted($this->unstructured); - $this->assertEquals($this->Name->getFormatted(), $this->unstructured); - } + + /** + * @var Name + */ + private $Name; + + /** + * @var additionalName + */ + public $additionalName; + + /** + * @var familyName + */ + public $familyName; + + /** + * @var givenName + */ + public $givenName; + + /** + * @var honorificPrefix + */ + public $honorificPrefix; + + /** + * @var honorificSuffix + */ + public $honorificSuffix; + + /** + * @var unstructured + */ + public $unstructured = ''; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() { + parent::setUp(); + $this->Name = new Name($this->unstructured); + + } + + /** + * Cleans up the environment after running a test. + */ + protected function tearDown() { + $this->Name = null; + + parent::tearDown(); + } + + /** + * Tests Name->getAdditionalName() + */ + public function testGetAdditionalName() { + $this->Name->additionalName = $this->additionalName; + $this->assertEquals($this->Name->getAdditionalName(), $this->additionalName); + } + + /** + * Tests Name->getFamilyName() + */ + public function testGetFamilyName() { + $this->Name->familyName = $this->familyName; + $this->assertEquals($this->Name->getFamilyName(), $this->familyName); + } + + /** + * Tests Name->getGivenName() + */ + public function testGetGivenName() { + $this->Name->givenName = $this->givenName; + $this->assertEquals($this->Name->getGivenName(), $this->givenName); + } + + /** + * Tests Name->getHonorificPrefix() + */ + public function testGetHonorificPrefix() { + $this->Name->honorificPrefix = $this->honorificPrefix; + $this->assertEquals($this->Name->getHonorificPrefix(), $this->honorificPrefix); + } + + /** + * Tests Name->getHonorificSuffix() + */ + public function testGetHonorificSuffix() { + $this->Name->honorificSuffix = $this->honorificSuffix; + $this->assertEquals($this->Name->getHonorificSuffix(), $this->honorificSuffix); + } + + /** + * Tests Name->getUnstructured() + */ + public function testGetUnstructured() { + $this->Name->unstructured = $this->unstructured; + $this->assertEquals($this->Name->getFormatted(), $this->unstructured); + } + + /** + * Tests Name->setAdditionalName() + */ + public function testSetAdditionalName() { + $this->Name->setAdditionalName($this->additionalName); + $this->assertEquals($this->Name->getAdditionalName(), $this->additionalName); + } + + /** + * Tests Name->setFamilyName() + */ + public function testSetFamilyName() { + $this->Name->setFamilyName($this->familyName); + $this->assertEquals($this->Name->getFamilyName(), $this->familyName); + } + + /** + * Tests Name->setGivenName() + */ + public function testSetGivenName() { + $this->Name->setGivenName($this->givenName); + $this->assertEquals($this->Name->getGivenName(), $this->givenName); + } + + /** + * Tests Name->setHonorificPrefix() + */ + public function testSetHonorificPrefix() { + $this->Name->setHonorificPrefix($this->honorificPrefix); + $this->assertEquals($this->Name->getHonorificPrefix(), $this->honorificPrefix); + + } + + /** + * Tests Name->setHonorificSuffix() + */ + public function testSetHonorificSuffix() { + $this->Name->setHonorificSuffix($this->honorificSuffix); + $this->assertEquals($this->Name->getHonorificSuffix(), $this->honorificSuffix); + } + + /** + * Tests Name->setUnstructured() + */ + public function testSetUnstructured() { + $this->Name->setFormatted($this->unstructured); + $this->assertEquals($this->Name->getFormatted(), $this->unstructured); + } } Modified: incubator/shindig/trunk/php/test/social/OrganizationTest.php URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/test/social/OrganizationTest.php?rev=719967&r1=719966&r2=719967&view=diff ============================================================================== --- incubator/shindig/trunk/php/test/social/OrganizationTest.php (original) +++ incubator/shindig/trunk/php/test/social/OrganizationTest.php Sun Nov 23 01:17:03 2008 @@ -1,228 +1,207 @@ <?php -/* +/** * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ /** * Organization test case. */ class OrganizationTest extends PHPUnit_Framework_TestCase { - - /** - * @var Organization - */ - private $Organization; - - /** - * Prepares the environment before running a test. - */ - protected function setUp() - { - parent::setUp(); - - $this->Organization = new Organization(/* parameters */); - $this->Organization->address = 'ADDRESS'; - $this->Organization->description = 'DESCRIPTION'; - $this->Organization->endDate = 'ENDDATE'; - $this->Organization->field = 'FIELD'; - $this->Organization->name = 'NAME'; - $this->Organization->salary = 'SALARY'; - $this->Organization->startDate = 'STARTDATE'; - $this->Organization->subField = 'SUBFIELD'; - $this->Organization->title = 'TITLE'; - $this->Organization->webpage = 'WEBPAGE'; - } - - /** - * Cleans up the environment after running a test. - */ - protected function tearDown() - { - $this->Organization = null; - parent::tearDown(); - } - - /** - * Tests Organization->getAddress() - */ - public function testGetAddress() - { - $this->assertEquals('ADDRESS', $this->Organization->getAddress()); - } - - /** - * Tests Organization->getDescription() - */ - public function testGetDescription() - { - $this->assertEquals('DESCRIPTION', $this->Organization->getDescription()); - } - - /** - * Tests Organization->getEndDate() - */ - public function testGetEndDate() - { - $this->assertEquals('ENDDATE', $this->Organization->getEndDate()); - } - - /** - * Tests Organization->getField() - */ - public function testGetField() - { - $this->assertEquals('FIELD', $this->Organization->getField()); - } - - /** - * Tests Organization->getName() - */ - public function testGetName() - { - $this->assertEquals('NAME', $this->Organization->getName()); - } - - /** - * Tests Organization->getSalary() - */ - public function testGetSalary() - { - $this->assertEquals('SALARY', $this->Organization->getSalary()); - } - - /** - * Tests Organization->getStartDate() - */ - public function testGetStartDate() - { - $this->assertEquals('STARTDATE', $this->Organization->getStartDate()); - } - - /** - * Tests Organization->getSubField() - */ - public function testGetSubField() - { - $this->assertEquals('SUBFIELD', $this->Organization->getSubField()); - } - - /** - * Tests Organization->getTitle() - */ - public function testGetTitle() - { - $this->assertEquals('TITLE', $this->Organization->getTitle()); - } - - /** - * Tests Organization->getWebpage() - */ - public function testGetWebpage() - { - $this->assertEquals('WEBPAGE', $this->Organization->getWebpage()); - } - - /** - * Tests Organization->setAddress() - */ - public function testSetAddress() - { - $this->Organization->setAddress('address'); - $this->assertEquals('address', $this->Organization->address); - } - - /** - * Tests Organization->setDescription() - */ - public function testSetDescription() - { - $this->Organization->setDescription('description'); - $this->assertEquals('description', $this->Organization->description); - } - - /** - * Tests Organization->setEndDate() - */ - public function testSetEndDate() - { - $this->Organization->setEndDate('enddate'); - $this->assertEquals('enddate', $this->Organization->endDate); - } - - /** - * Tests Organization->setField() - */ - public function testSetField() - { - $this->Organization->setField('field'); - $this->assertEquals('field', $this->Organization->field); - } - - /** - * Tests Organization->setName() - */ - public function testSetName() - { - $this->Organization->setName('name'); - $this->assertEquals('name', $this->Organization->name); - } - - /** - * Tests Organization->setSalary() - */ - public function testSetSalary() - { - $this->Organization->setSalary('salary'); - $this->assertEquals('salary', $this->Organization->salary); - } - - /** - * Tests Organization->setStartDate() - */ - public function testSetStartDate() - { - $this->Organization->setStartDate('startdate'); - $this->assertEquals('startdate', $this->Organization->startDate); - } - - /** - * Tests Organization->setSubField() - */ - public function testSetSubField() - { - $this->Organization->setSubField('subfield'); - $this->assertEquals('subfield', $this->Organization->subField); - } - - /** - * Tests Organization->setTitle() - */ - public function testSetTitle() - { - $this->Organization->setTitle('title'); - $this->assertEquals('title', $this->Organization->title); - } - - /** - * Tests Organization->setWebpage() - */ - public function testSetWebpage() - { - $this->Organization->setWebpage('webpage'); - $this->assertEquals('webpage', $this->Organization->webpage); - } + + /** + * @var Organization + */ + private $Organization; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() { + parent::setUp(); + + $this->Organization = new Organization(/* parameters */); + $this->Organization->address = 'ADDRESS'; + $this->Organization->description = 'DESCRIPTION'; + $this->Organization->endDate = 'ENDDATE'; + $this->Organization->field = 'FIELD'; + $this->Organization->name = 'NAME'; + $this->Organization->salary = 'SALARY'; + $this->Organization->startDate = 'STARTDATE'; + $this->Organization->subField = 'SUBFIELD'; + $this->Organization->title = 'TITLE'; + $this->Organization->webpage = 'WEBPAGE'; + } + + /** + * Cleans up the environment after running a test. + */ + protected function tearDown() { + $this->Organization = null; + parent::tearDown(); + } + + /** + * Tests Organization->getAddress() + */ + public function testGetAddress() { + $this->assertEquals('ADDRESS', $this->Organization->getAddress()); + } + + /** + * Tests Organization->getDescription() + */ + public function testGetDescription() { + $this->assertEquals('DESCRIPTION', $this->Organization->getDescription()); + } + + /** + * Tests Organization->getEndDate() + */ + public function testGetEndDate() { + $this->assertEquals('ENDDATE', $this->Organization->getEndDate()); + } + + /** + * Tests Organization->getField() + */ + public function testGetField() { + $this->assertEquals('FIELD', $this->Organization->getField()); + } + + /** + * Tests Organization->getName() + */ + public function testGetName() { + $this->assertEquals('NAME', $this->Organization->getName()); + } + + /** + * Tests Organization->getSalary() + */ + public function testGetSalary() { + $this->assertEquals('SALARY', $this->Organization->getSalary()); + } + + /** + * Tests Organization->getStartDate() + */ + public function testGetStartDate() { + $this->assertEquals('STARTDATE', $this->Organization->getStartDate()); + } + + /** + * Tests Organization->getSubField() + */ + public function testGetSubField() { + $this->assertEquals('SUBFIELD', $this->Organization->getSubField()); + } + + /** + * Tests Organization->getTitle() + */ + public function testGetTitle() { + $this->assertEquals('TITLE', $this->Organization->getTitle()); + } + + /** + * Tests Organization->getWebpage() + */ + public function testGetWebpage() { + $this->assertEquals('WEBPAGE', $this->Organization->getWebpage()); + } + + /** + * Tests Organization->setAddress() + */ + public function testSetAddress() { + $this->Organization->setAddress('address'); + $this->assertEquals('address', $this->Organization->address); + } + + /** + * Tests Organization->setDescription() + */ + public function testSetDescription() { + $this->Organization->setDescription('description'); + $this->assertEquals('description', $this->Organization->description); + } + + /** + * Tests Organization->setEndDate() + */ + public function testSetEndDate() { + $this->Organization->setEndDate('enddate'); + $this->assertEquals('enddate', $this->Organization->endDate); + } + + /** + * Tests Organization->setField() + */ + public function testSetField() { + $this->Organization->setField('field'); + $this->assertEquals('field', $this->Organization->field); + } + + /** + * Tests Organization->setName() + */ + public function testSetName() { + $this->Organization->setName('name'); + $this->assertEquals('name', $this->Organization->name); + } + + /** + * Tests Organization->setSalary() + */ + public function testSetSalary() { + $this->Organization->setSalary('salary'); + $this->assertEquals('salary', $this->Organization->salary); + } + + /** + * Tests Organization->setStartDate() + */ + public function testSetStartDate() { + $this->Organization->setStartDate('startdate'); + $this->assertEquals('startdate', $this->Organization->startDate); + } + + /** + * Tests Organization->setSubField() + */ + public function testSetSubField() { + $this->Organization->setSubField('subfield'); + $this->assertEquals('subfield', $this->Organization->subField); + } + + /** + * Tests Organization->setTitle() + */ + public function testSetTitle() { + $this->Organization->setTitle('title'); + $this->assertEquals('title', $this->Organization->title); + } + + /** + * Tests Organization->setWebpage() + */ + public function testSetWebpage() { + $this->Organization->setWebpage('webpage'); + $this->assertEquals('webpage', $this->Organization->webpage); + } } Modified: incubator/shindig/trunk/php/test/social/OutputAtomConverterTest.php URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/test/social/OutputAtomConverterTest.php?rev=719967&r1=719966&r2=719967&view=diff ============================================================================== --- incubator/shindig/trunk/php/test/social/OutputAtomConverterTest.php (original) +++ incubator/shindig/trunk/php/test/social/OutputAtomConverterTest.php Sun Nov 23 01:17:03 2008 @@ -1,68 +1,66 @@ <?php -/* +/** * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ /** * OutputAtomConverter test case. */ class OutputAtomConverterTest extends PHPUnit_Framework_TestCase { - - /** - * @var OutputAtomConverter - */ - private $OutputAtomConverter; - - /** - * Prepares the environment before running a test. - */ - protected function setUp() - { - parent::setUp(); - $this->OutputAtomConverter = new OutputAtomConverter(); - } - - /** - * Cleans up the environment after running a test. - */ - protected function tearDown() - { - $this->OutputAtomConverter = null; - parent::tearDown(); - } - - /** - * Tests OutputAtomConverter->outputResponse() - */ - public function testOutputResponse() - { - $inputConverter = new InputAtomConverter(); - $outputConverter = new OutputAtomConverter(); - $servletRequest = array('url' => '/people/1/@self'); - $requestItem = RestRequestItem::createWithRequest($servletRequest, null, - $inputConverter, $outputConverter); - $requestItem->applyUrlTemplate("/people/{userId}/{groupId}/{personId}"); - $response = array( 'entry' => array('isOwner' => false, - 'isViewer' => false, 'displayName' => '1 1', 'id' => '1')); - $responseItem = new ResponseItem(null, null, $response); - ob_start(); - $outputConverter->outputResponse($responseItem, $requestItem); - $output = ob_get_clean(); - $expected = '<?xml version="1.0" encoding="UTF-8"?> + + /** + * @var OutputAtomConverter + */ + private $OutputAtomConverter; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() { + parent::setUp(); + $this->OutputAtomConverter = new OutputAtomConverter(); + } + + /** + * Cleans up the environment after running a test. + */ + protected function tearDown() { + $this->OutputAtomConverter = null; + parent::tearDown(); + } + + /** + * Tests OutputAtomConverter->outputResponse() + */ + public function testOutputResponse() { + $inputConverter = new InputAtomConverter(); + $outputConverter = new OutputAtomConverter(); + $servletRequest = array('url' => '/people/1/@self'); + $requestItem = RestRequestItem::createWithRequest($servletRequest, null, $inputConverter, $outputConverter); + $requestItem->applyUrlTemplate("/people/{userId}/{groupId}/{personId}"); + $response = array( + 'entry' => array('isOwner' => false, 'isViewer' => false, 'displayName' => '1 1', + 'id' => '1')); + $responseItem = new ResponseItem(null, null, $response); + ob_start(); + $outputConverter->outputResponse($responseItem, $requestItem); + $output = ob_get_clean(); + $expected = '<?xml version="1.0" encoding="UTF-8"?> <entry xmlns="http://www.w3.org/2005/Atom"> <title>person entry for shindig:1</title> <author> @@ -83,11 +81,11 @@ </content> </entry> '; - $outputXml = simplexml_load_string($output); - $expectedXml = simplexml_load_string($expected); - $expectedXml->updated = $outputXml->updated; - $this->assertEquals($expectedXml, $outputXml); - } + $outputXml = simplexml_load_string($output); + $expectedXml = simplexml_load_string($expected); + $expectedXml->updated = $outputXml->updated; + $this->assertEquals($expectedXml, $outputXml); + } } Modified: incubator/shindig/trunk/php/test/social/OutputJsonConverterTest.php URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/test/social/OutputJsonConverterTest.php?rev=719967&r1=719966&r2=719967&view=diff ============================================================================== --- incubator/shindig/trunk/php/test/social/OutputJsonConverterTest.php (original) +++ incubator/shindig/trunk/php/test/social/OutputJsonConverterTest.php Sun Nov 23 01:17:03 2008 @@ -1,68 +1,66 @@ <?php -/* +/** * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ /** * OutputJsonConverter test case. */ class OutputJsonConverterTest extends PHPUnit_Framework_TestCase { - - /** - * @var OutputJsonConverter - */ - private $OutputJsonConverter; - - /** - * Prepares the environment before running a test. - */ - protected function setUp() - { - parent::setUp(); - $this->OutputJsonConverter = new OutputJsonConverter(); - } - - /** - * Cleans up the environment after running a test. - */ - protected function tearDown() - { - $this->OutputJsonConverter = null; - parent::tearDown(); - } - - /** - * Tests OutputJsonConverter->outputResponse() - */ - public function testOutputResponse() - { - $inputConverter = new InputJsonConverter(); - $outputConverter = new OutputJsonConverter(); - $servletRequest = array('url' => '/people/1/@self'); - $requestItem = RestRequestItem::createWithRequest($servletRequest, null, - $inputConverter, $outputConverter); - $requestItem->applyUrlTemplate("/people/{userId}/{groupId}/{personId}"); - $response = array( 'entry' => array('isOwner' => false, - 'isViewer' => false, 'displayName' => '1 1', 'id' => '1')); - $responseItem = new ResponseItem(null, null, $response); - ob_start(); - $outputConverter->outputResponse($responseItem, $requestItem); - $output = ob_get_clean(); - $expected = '{ + + /** + * @var OutputJsonConverter + */ + private $OutputJsonConverter; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() { + parent::setUp(); + $this->OutputJsonConverter = new OutputJsonConverter(); + } + + /** + * Cleans up the environment after running a test. + */ + protected function tearDown() { + $this->OutputJsonConverter = null; + parent::tearDown(); + } + + /** + * Tests OutputJsonConverter->outputResponse() + */ + public function testOutputResponse() { + $inputConverter = new InputJsonConverter(); + $outputConverter = new OutputJsonConverter(); + $servletRequest = array('url' => '/people/1/@self'); + $requestItem = RestRequestItem::createWithRequest($servletRequest, null, $inputConverter, $outputConverter); + $requestItem->applyUrlTemplate("/people/{userId}/{groupId}/{personId}"); + $response = array( + 'entry' => array('isOwner' => false, 'isViewer' => false, 'displayName' => '1 1', + 'id' => '1')); + $responseItem = new ResponseItem(null, null, $response); + ob_start(); + $outputConverter->outputResponse($responseItem, $requestItem); + $output = ob_get_clean(); + $expected = '{ "entry": { "isOwner": false, "isViewer": false, @@ -70,8 +68,8 @@ "id": "1" } }'; - $this->assertEquals($expected, $output); - } + $this->assertEquals($expected, $output); + } } Modified: incubator/shindig/trunk/php/test/social/OutputXmlConverterTest.php URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/php/test/social/OutputXmlConverterTest.php?rev=719967&r1=719966&r2=719967&view=diff ============================================================================== --- incubator/shindig/trunk/php/test/social/OutputXmlConverterTest.php (original) +++ incubator/shindig/trunk/php/test/social/OutputXmlConverterTest.php Sun Nov 23 01:17:03 2008 @@ -1,68 +1,66 @@ <?php -/* +/** * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file + * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file + * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ /** * OutputXmlConverter test case. */ class OutputXmlConverterTest extends PHPUnit_Framework_TestCase { - - /** - * @var OutputXmlConverter - */ - private $OutputXmlConverter; - - /** - * Prepares the environment before running a test. - */ - protected function setUp() - { - parent::setUp(); - $this->OutputXmlConverter = new OutputXmlConverter(); - } - - /** - * Cleans up the environment after running a test. - */ - protected function tearDown() - { - $this->OutputXmlConverter = null; - parent::tearDown(); - } - - /** - * Tests OutputXmlConverter->outputResponse() - */ - public function testOutputResponse() - { - $inputConverter = new InputXmlConverter(); - $outputConverter = new OutputXmlConverter(); - $servletRequest = array('url' => '/people/1/@self'); - $requestItem = RestRequestItem::createWithRequest($servletRequest, null, - $inputConverter, $outputConverter); - $requestItem->applyUrlTemplate("/people/{userId}/{groupId}/{personId}"); - $response = array( 'entry' => array('isOwner' => false, - 'isViewer' => false, 'displayName' => '1 1', 'id' => '1')); - $responseItem = new ResponseItem(null, null, $response); - ob_start(); - $outputConverter->outputResponse($responseItem, $requestItem); - $output = ob_get_clean(); - $expected = '<?xml version="1.0" encoding="UTF-8"?> + + /** + * @var OutputXmlConverter + */ + private $OutputXmlConverter; + + /** + * Prepares the environment before running a test. + */ + protected function setUp() { + parent::setUp(); + $this->OutputXmlConverter = new OutputXmlConverter(); + } + + /** + * Cleans up the environment after running a test. + */ + protected function tearDown() { + $this->OutputXmlConverter = null; + parent::tearDown(); + } + + /** + * Tests OutputXmlConverter->outputResponse() + */ + public function testOutputResponse() { + $inputConverter = new InputXmlConverter(); + $outputConverter = new OutputXmlConverter(); + $servletRequest = array('url' => '/people/1/@self'); + $requestItem = RestRequestItem::createWithRequest($servletRequest, null, $inputConverter, $outputConverter); + $requestItem->applyUrlTemplate("/people/{userId}/{groupId}/{personId}"); + $response = array( + 'entry' => array('isOwner' => false, 'isViewer' => false, 'displayName' => '1 1', + 'id' => '1')); + $responseItem = new ResponseItem(null, null, $response); + ob_start(); + $outputConverter->outputResponse($responseItem, $requestItem); + $output = ob_get_clean(); + $expected = '<?xml version="1.0" encoding="UTF-8"?> <response> <person> <entry> @@ -74,8 +72,8 @@ </person> </response> '; - $this->assertEquals($expected, $output); - } + $this->assertEquals($expected, $output); + } }
