summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCiro Mattia Gonano <ciromattia@gmail.com>2013-09-11 15:56:48 +0200
committerCiro Mattia Gonano <ciromattia@gmail.com>2013-09-11 15:57:07 +0200
commit3069eaf35e833ffe4a1c1c7829dd7e168ae27420 (patch)
treed0c2e4d934cc34ba7d4232f759923b5a257dcb21 /tests
parentb833247ce597ec26159b46c8dfbea7f1e265950b (diff)
Merge up to r3319
Diffstat (limited to 'tests')
-rw-r--r--tests/FunctionalTests/tickets/tests/Ticket785TestCase.php5
-rw-r--r--tests/test_tools/functional_tests.php7
-rw-r--r--tests/unit/Web/THttpRequestTest.php2
-rw-r--r--tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php8
4 files changed, 17 insertions, 5 deletions
diff --git a/tests/FunctionalTests/tickets/tests/Ticket785TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket785TestCase.php
index 53851f7a..153422be 100644
--- a/tests/FunctionalTests/tickets/tests/Ticket785TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket785TestCase.php
@@ -3,14 +3,15 @@ class Ticket785TestCase extends SeleniumTestCase
{
function test()
{
+ $year=date('Y')-1;
$base = 'ctl0_Content_';
$this->open('tickets/index.php?page=Ticket785');
$this->assertTitle("Verifying Ticket 785");
$this->assertText('selDate', '');
- $this->select($base."datePicker_year", "2007");
+ $this->select($base."datePicker_year", $year);
$this->pause(800);
- $expectedDate=date("d-m").'-2007';
+ $expectedDate=date("d-m").'-'.$year;
$this->assertText('selDate', $expectedDate);
$this->click($base."datePickerbutton");
diff --git a/tests/test_tools/functional_tests.php b/tests/test_tools/functional_tests.php
index 73bd6226..151f77db 100644
--- a/tests/test_tools/functional_tests.php
+++ b/tests/test_tools/functional_tests.php
@@ -4,8 +4,11 @@ $TEST_TOOLS = dirname(__FILE__);
if(isset($_GET['sr']))
{
-
- if(($selenium_resource=realpath($TEST_TOOLS.'/selenium/'.$_GET['sr']))!==false)
+ $selenium_base=$TEST_TOOLS.'/selenium/';
+ $selenium_resource=realpath($selenium_base.$_GET['sr']);
+
+ if($selenium_resource!==false &&
+ strpos($selenium_resource, $selenium_base) === 0)
echo file_get_contents($selenium_resource);
exit;
}
diff --git a/tests/unit/Web/THttpRequestTest.php b/tests/unit/Web/THttpRequestTest.php
index e8b86ac8..a5f17f01 100644
--- a/tests/unit/Web/THttpRequestTest.php
+++ b/tests/unit/Web/THttpRequestTest.php
@@ -84,6 +84,7 @@ class THttpRequestTest extends PHPUnit_Framework_TestCase {
$request->setUrlManager('invalidManagerId');
try {
$request->init(null);
+ $request->getUrlManagerModule();
self::fail ('httprequest_urlmanager_inexist exception not thrown');
} catch (TConfigurationException $e) {
@@ -98,6 +99,7 @@ class THttpRequestTest extends PHPUnit_Framework_TestCase {
$request->setUrlManager('badmanager');
try {
$request->init(null);
+ $request->getUrlManagerModule();
self::fail ('httprequest_urlmanager_invalid exception not thrown');
} catch (TConfigurationException $e) {
diff --git a/tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php b/tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php
index ae8ac1f5..e84b3cf3 100644
--- a/tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php
+++ b/tests/unit/Web/UI/WebControls/TRequiredFieldValidatorTest.php
@@ -10,7 +10,13 @@ class TRequiredFieldValidatorTest extends PHPUnit_Framework_TestCase {
public function testGetEmptyInitialValue() {
$validator = new TRequiredFieldValidator();
- $this->assertEquals('', $validator->getInitialValue());
+ try {
+ $value = $validator->getInitialValue();
+ } catch (TConfigurationException $e) {
+ //since prado 3.2.2 you need to set at least ControlToValidate
+ $value = '';
+ }
+ $this->assertEquals('', $value);
}
}