From 2bf1a517f3edc1bd43b8e3340f0f6fd31b1ba94a Mon Sep 17 00:00:00 2001 From: David Date: Mon, 10 Aug 2015 06:42:01 +0200 Subject: fix unit tests --- tests/unit/Caching/TAPCCacheTest.php | 6 +++- .../unit/Caching/TDirectoryCacheDependencyTest.php | 2 ++ tests/unit/Caching/TFileCacheDependencyTest.php | 1 + tests/unit/Caching/TMemCacheTest.php | 4 ++- tests/unit/Caching/TSqliteCacheTest.php | 4 ++- .../unit/Collections/TAttributeCollectionTest.php | 4 ++- tests/unit/Collections/TListTest.php | 5 +++ tests/unit/Collections/TMapTest.php | 5 +++ tests/unit/Collections/TPagedDataSourceTest.php | 1 - tests/unit/Collections/TPagedListTest.php | 6 +++- tests/unit/Collections/TPriorityListTest.php | 7 +++- tests/unit/Collections/TPriorityMapTest.php | 6 +++- tests/unit/Collections/TQueueTest.php | 5 ++- tests/unit/Collections/TStackTest.php | 5 ++- tests/unit/Data/DataGateway/TSqlCriteriaTest.php | 3 +- .../Data/SqlMap/DataMapper/TPropertyAccessTest.php | 4 +-- tests/unit/Data/SqlMap/DynamicParameterTest.php | 7 ++-- tests/unit/Data/TDbCommandTest.php | 6 +++- tests/unit/Data/TDbConnectionTest.php | 8 ++++- tests/unit/Data/TDbDataReaderTest.php | 5 ++- tests/unit/Data/TDbTransactionTest.php | 4 ++- tests/unit/I18N/core/ChoiceFormatTest.php | 3 +- tests/unit/I18N/core/CultureInfoTest.php | 3 +- tests/unit/I18N/core/DateFormatTest.php | 3 +- tests/unit/I18N/core/DateTimeFormatInfoTest.php | 3 +- tests/unit/I18N/core/NumberFormatInfoTest.php | 3 +- tests/unit/I18N/core/NumberFormatTest.php | 3 +- tests/unit/IO/TTarFileExtractorTest.php | 1 - tests/unit/IO/TTextWriterTest.php | 3 +- tests/unit/PradoBaseTest.php | 40 ++++++++++++++++++++++ tests/unit/Security/TAuthManagerTest.php | 10 ++++-- tests/unit/Security/TAuthorizationRuleTest.php | 1 - tests/unit/Security/TSecurityManagerTest.php | 6 +++- tests/unit/Security/TUserManagerTest.php | 9 ++++- tests/unit/Security/TUserTest.php | 8 +++-- tests/unit/TComponentTest.php | 20 +++++++---- tests/unit/Util/TDateTimeStampTest.php | 3 +- tests/unit/Util/TLoggerTest.php | 1 - tests/unit/Util/TSimpleDateFormatterTest.php | 3 +- tests/unit/Web/TAssetManagerTest.php | 8 ++++- tests/unit/Web/TCacheHttpSessionTest.php | 7 ++-- tests/unit/Web/THttpCookieCollectionTest.php | 6 +++- tests/unit/Web/THttpCookieTest.php | 3 +- tests/unit/Web/THttpRequestTest.php | 14 ++++++-- tests/unit/Web/THttpResponseTest.php | 6 +++- tests/unit/Web/THttpSessionTest.php | 4 ++- tests/unit/Web/THttpUtilityTest.php | 3 +- tests/unit/Web/TUriTest.php | 4 ++- .../UI/ActiveControls/TActiveHiddenFieldTest.php | 3 +- tests/unit/Web/UI/TClientScriptManagerTest.php | 1 - tests/unit/Web/UI/TControlAdapterTest.php | 1 - tests/unit/Web/UI/TControlTest.php | 1 - tests/unit/Web/UI/TFormTest.php | 1 - tests/unit/Web/UI/THtmlWriterTest.php | 6 +++- tests/unit/Web/UI/TPageStatePersisterTest.php | 1 - tests/unit/Web/UI/TPageTest.php | 1 - .../unit/Web/UI/TSessionPageStatePersisterTest.php | 1 - tests/unit/Web/UI/TTemplateControlTest.php | 1 - tests/unit/Web/UI/TTemplateManagerTest.php | 1 - tests/unit/Web/UI/TTemplateTest.php | 1 - tests/unit/Web/UI/TThemeManagerTest.php | 1 - tests/unit/Web/UI/TThemeTest.php | 1 - .../unit/Web/UI/WebControls/TDropDownListTest.php | 4 ++- tests/unit/Web/UI/WebControls/TLabelTest.php | 4 +-- .../UI/WebControls/TRequiredFieldValidatorTest.php | 4 ++- .../unit/Web/UI/WebControls/TXmlTransformTest.php | 7 ++-- tests/unit/Xml/TXmlDocumentTest.php | 5 ++- tests/unit/Xml/TXmlElementListTest.php | 5 ++- tests/unit/Xml/TXmlElementTest.php | 4 ++- 69 files changed, 252 insertions(+), 78 deletions(-) create mode 100644 tests/unit/PradoBaseTest.php (limited to 'tests/unit') diff --git a/tests/unit/Caching/TAPCCacheTest.php b/tests/unit/Caching/TAPCCacheTest.php index ccb6ee85..d5ea4f92 100644 --- a/tests/unit/Caching/TAPCCacheTest.php +++ b/tests/unit/Caching/TAPCCacheTest.php @@ -1,6 +1,10 @@ data = $d; } } -Prado::using('System.Collections.TPriorityList'); /** * All Test cases for the TList are here. The TPriorityList should act just like a TList when used exactly like a TList diff --git a/tests/unit/Collections/TPriorityMapTest.php b/tests/unit/Collections/TPriorityMapTest.php index 847e09fe..8aa9110d 100644 --- a/tests/unit/Collections/TPriorityMapTest.php +++ b/tests/unit/Collections/TPriorityMapTest.php @@ -1,10 +1,14 @@ assertFalse(class_exists(self::CLASS_FQN, false)); + Prado::using(self::CLASS_FQN); + $this->assertTrue(class_exists(self::CLASS_FQN, false)); + } + + public function testUsingInterface() + { + $this->assertFalse(interface_exists(self::INTERFACE_SHORT_NAME, false)); + Prado::using(self::INTERFACE_FQN); + $this->assertTrue(interface_exists(self::INTERFACE_SHORT_NAME, false)); + } + + public function testCreateComponentWithNamespace() + { + $this->assertInstanceOf(self::CLASS_FQN, Prado::createComponent(self::CLASS_FQN)); + } + + public function testCreateComponentWithPradoNamespace() + { + $this->assertInstanceOf(self::CLASS_FQN, Prado::createComponent(self::CLASS_PRADO_FULLNAME)); + } + + +} diff --git a/tests/unit/Security/TAuthManagerTest.php b/tests/unit/Security/TAuthManagerTest.php index 3b8b9305..b61953e5 100644 --- a/tests/unit/Security/TAuthManagerTest.php +++ b/tests/unit/Security/TAuthManagerTest.php @@ -1,8 +1,12 @@ assertEquals(array('TComponent', 'NewComponent', 'NewComponentNoListen', 'DynamicCatchingComponent'), $component->getClassHierarchy()); - $this->assertEquals(array('TComponent', 'NewComponent', 'NewComponentNoListen', 'DynamicCatchingComponent'), $component->getClassHierarchy(false)); - $this->assertEquals(array('tcomponent', 'newcomponent', 'newcomponentnolisten', 'dynamiccatchingcomponent'), $component->getClassHierarchy(true)); + $this->assertEquals(array('Prado\TComponent', 'NewComponent', 'NewComponentNoListen', 'DynamicCatchingComponent'), $component->getClassHierarchy()); + $this->assertEquals(array('Prado\TComponent', 'NewComponent', 'NewComponentNoListen', 'DynamicCatchingComponent'), $component->getClassHierarchy(false)); + $this->assertEquals(array('prado\tcomponent', 'newcomponent', 'newcomponentnolisten', 'dynamiccatchingcomponent'), $component->getClassHierarchy(true)); } diff --git a/tests/unit/Util/TDateTimeStampTest.php b/tests/unit/Util/TDateTimeStampTest.php index 37784ef3..6d2a7c24 100644 --- a/tests/unit/Util/TDateTimeStampTest.php +++ b/tests/unit/Util/TDateTimeStampTest.php @@ -1,7 +1,8 @@