From edb21c27fa7b7d2778414d9b15fec58923db560b Mon Sep 17 00:00:00 2001 From: HadrienMP Date: Mon, 2 Dec 2013 12:05:38 +0000 Subject: [PATCH 1/3] Upgrade for CodeIgniter 2.1.3 and PHP 5.4 --- application/controllers/test.php | 17 +++--- .../language/chinese}/unit_test_lang.php | 0 application/language/dutch/unit_test_lang.php | 27 +++++++++ .../language/english/unit_test_lang.php | 27 +++++++++ .../language/french/unit_test_lang.php | 27 +++++++++ .../language/german/unit_test_lang.php | 27 +++++++++ .../language/italian/unit_test_lang.php | 27 +++++++++ .../language/japanese/unit_test_lang.php | 27 +++++++++ .../language/portuguese/unit_test_lang.php | 27 +++++++++ .../language/romanian/unit_test_lang.php | 27 +++++++++ .../language/russian/unit_test_lang.php | 27 +++++++++ .../language/spanish/unit_test_lang.php | 27 +++++++++ application/libraries/MY_Unit_test.php | 4 +- application/views/unit_test.php | 59 ++++++++++--------- 14 files changed, 313 insertions(+), 37 deletions(-) rename {system/language/english => application/language/chinese}/unit_test_lang.php (100%) create mode 100644 application/language/dutch/unit_test_lang.php create mode 100644 application/language/english/unit_test_lang.php create mode 100644 application/language/french/unit_test_lang.php create mode 100644 application/language/german/unit_test_lang.php create mode 100644 application/language/italian/unit_test_lang.php create mode 100644 application/language/japanese/unit_test_lang.php create mode 100644 application/language/portuguese/unit_test_lang.php create mode 100644 application/language/romanian/unit_test_lang.php create mode 100644 application/language/russian/unit_test_lang.php create mode 100644 application/language/spanish/unit_test_lang.php diff --git a/application/controllers/test.php b/application/controllers/test.php index 26dbcee..f6b7e29 100644 --- a/application/controllers/test.php +++ b/application/controllers/test.php @@ -8,19 +8,20 @@ * @copyright Copyright (C) 2010 Istvan Pusztai (twitter.com/istvanp) **/ -class Test extends Controller { +class Test extends CI_Controller { - var $timings = array(); - var $tests = array(); + private $timings = array(); + private $tests = array(); /** * Constructor function * * @return void **/ - function Test() + public function __construct() + { - parent::Controller(); + parent::__construct(); // Set time marker for the start of the test suite $this->benchmark->mark('first'); @@ -38,7 +39,7 @@ function Test() // Disable database debugging so we can test all units without stopping // at the first SQL error - $this->db->db_debug = FALSE; + // $this->db->db_debug = FALSE; // Create list of tests $this->_map_tests(); @@ -130,7 +131,7 @@ function user_model() * @author Istvan Pusztai * @return void **/ - function _remap() + public function _remap() { $view_data = array(); $action = $this->uri->rsegment(2); @@ -220,7 +221,7 @@ function _remap() * @author Istvan Pusztai * @return void **/ - function _map_tests() + public function _map_tests() { $methods = get_class_methods($this); natsort($methods); diff --git a/system/language/english/unit_test_lang.php b/application/language/chinese/unit_test_lang.php similarity index 100% rename from system/language/english/unit_test_lang.php rename to application/language/chinese/unit_test_lang.php diff --git a/application/language/dutch/unit_test_lang.php b/application/language/dutch/unit_test_lang.php new file mode 100644 index 0000000..39a4636 --- /dev/null +++ b/application/language/dutch/unit_test_lang.php @@ -0,0 +1,27 @@ +CI =& get_instance(); } diff --git a/application/views/unit_test.php b/application/views/unit_test.php index 7d45634..83e1bee 100644 --- a/application/views/unit_test.php +++ b/application/views/unit_test.php @@ -1,8 +1,9 @@ +load->helper('url');?> Unit Testing › <?=ucfirst($type)?> -" charset="utf-8"> + - 0): ?> + 0) { ?>
- - 0): ?> + + 0) { ?>
/ tests passed in seconds
- $test): - if (array_key_exists($key, $headings['types'])) - echo "

{$headings['types'][$key]}

\n"; - if (array_key_exists($key, $headings['tests'])) - echo "

{$headings['tests'][$key]}

\n"; + + $test) { + if (array_key_exists($key, $headings['types'])) + echo "

{$headings['types'][$key]}

\n"; + if (array_key_exists($key, $headings['tests'])) + echo "

{$headings['tests'][$key]}

\n"; ?>
@@ -57,22 +62,22 @@ Expected (), returned - + - + ()
- - + + - - + + - + on line
- + - + \ No newline at end of file From 30c0cbdc754ded4a34b057b9f7d31221509c4538 Mon Sep 17 00:00:00 2001 From: HadrienMP Date: Mon, 2 Dec 2013 12:13:00 +0000 Subject: [PATCH 2/3] Brought into conformity with the original --- application/views/unit_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/unit_test.php b/application/views/unit_test.php index 83e1bee..4c7028b 100644 --- a/application/views/unit_test.php +++ b/application/views/unit_test.php @@ -3,7 +3,7 @@ load->helper('url');?> Unit Testing › <?=ucfirst($type)?> - +">