diff options
author | Arron Woods <me@arronwoods.com> | 2013-12-05 22:40:45 +0000 |
---|---|---|
committer | Arron Woods <me@arronwoods.com> | 2013-12-05 22:40:45 +0000 |
commit | ad0e2ffc901c27477bba23bf762215b7e2350d21 (patch) | |
tree | fde2e3020c30110a967142cd879c216538cb33bd /tests/library/SSRS/Object | |
parent | e0fd2e51a5546d0d85cf249a6ebf45f9e06e6017 (diff) | |
download | php-ssrs-ad0e2ffc901c27477bba23bf762215b7e2350d21.zip php-ssrs-ad0e2ffc901c27477bba23bf762215b7e2350d21.tar.gz php-ssrs-ad0e2ffc901c27477bba23bf762215b7e2350d21.tar.bz2 |
Tests almost back to passing
Diffstat (limited to 'tests/library/SSRS/Object')
-rwxr-xr-x | tests/library/SSRS/Object/AbstractTest.php | 30 | ||||
-rwxr-xr-x | tests/library/SSRS/Object/CatalogItemsTest.php | 69 |
2 files changed, 0 insertions, 99 deletions
diff --git a/tests/library/SSRS/Object/AbstractTest.php b/tests/library/SSRS/Object/AbstractTest.php deleted file mode 100755 index 3cfa8f4..0000000 --- a/tests/library/SSRS/Object/AbstractTest.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -class SSRS_Object_AbstractTest extends PHPUnit_Framework_TestCase { - - public function testSetDataWithStdClass() { - $data = new stdClass; - $data->test1 = 'a'; - $data->test2 = 'b'; - - $object = new SSRS_Object_Abstract($data); - - $this->assertEquals($data->test1, $object->test1); - $this->assertEquals($data->test2, $object->test2); - } - - public function testSetDataWithArray() { - $data = array('test1' => 'a', 'test2' => 'b'); - - $object = new SSRS_Object_Abstract($data); - - $this->assertEquals($data['test1'], $object->test1); - $this->assertEquals($data['test2'], $object->test2); - } - - public function testSetDataWithNull() { - $object = new SSRS_Object_Abstract(); - $this->assertEquals(array(), $object->data); - } - -}
\ No newline at end of file diff --git a/tests/library/SSRS/Object/CatalogItemsTest.php b/tests/library/SSRS/Object/CatalogItemsTest.php deleted file mode 100755 index e50df39..0000000 --- a/tests/library/SSRS/Object/CatalogItemsTest.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -require_once('SSRS/Object/Abstract.php'); -require_once('SSRS/Object/CatalogItems.php'); -require_once('SSRS/Object/CatalogItem.php'); - -/** - * Description of CatalogItemsTest - * - * @author arron - */ -class SSRS_Object_CatalogItemsTest extends PHPUnit_Framework_TestCase { - - public function testSetCatalogItems() { - $catalogItem1 = new stdClass; - $catalogItem1->ID = '1386fc6d-9c58-489f-adea-081146b62799'; - $catalogItem1->Name = 'Reference Report'; - $catalogItem1->Path = '/Reports/Reference Report'; - $catalogItem1->TypeName = 'Report'; - $catalogItem1->Size = '234413'; - $catalogItem1->CreationDate = '2011-03-03T12:32:57.063'; - $catalogItem1->ModifiedDate = '2011-03-03T12:51:12.05'; - $catalogItem1->CreatedBy = 'MSSQL\WebAccount'; - $catalogItem1->ModifiedBy = 'MSSQL\WebAccount'; - - $data = new stdClass; - $data->CatalogItems = new stdClass; - $data->CatalogItems->CatalogItem = array($catalogItem1); - - $expected = new SSRS_Object_CatalogItems(); - $expected->addCatalogItem(new SSRS_Object_CatalogItem($catalogItem1)); - - $object = new SSRS_Object_CatalogItems($data); - $this->assertEquals($expected, $object); - } - - /** - * @expectedException PHPUnit_Framework_Error - */ - public function testPassingInvalidObjectToAddCatalogItemThrowsError() { - $object = new SSRS_Object_CatalogItems(); - $object->addCatalogItem(new SSRS_Object_Abstract()); - } - - public function testCatalogItemsEmptyArrayOnInit() { - $object = new SSRS_Object_CatalogItems(); - $this->assertEquals(array(), $object->CatalogItems); - } - - public function testAddCatalogItem() { - $object = new SSRS_Object_CatalogItems(); - $object->addCatalogItem(new SSRS_Object_CatalogItem()); - - $this->assertEquals(1, count($object->CatalogItems)); - } - - public function testSetCatalogItemsKeepsCurrentItems() { - $dummy = new stdClass; - $dummy->CatalogItem[] = new SSRS_Object_CatalogItem(); - - $object = new SSRS_Object_CatalogItems(); - $object->setCatalogItems($dummy); - $this->assertEquals(1, count($object->CatalogItems)); - - $object->setCatalogItems($dummy); - $this->assertEquals(2, count($object->CatalogItems)); - } - -}
\ No newline at end of file |