summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/libraries
diff options
context:
space:
mode:
authordchill42 <dchill42@gmail.com>2012-11-25 02:23:21 +0100
committerdchill42 <dchill42@gmail.com>2012-11-25 08:47:39 +0100
commit1713d322a309d9cf405cfe83e2131368f29b222b (patch)
tree7908487f27840c04b28909363093d77de3415249 /tests/codeigniter/libraries
parentad5f1d032fb3204bc1b81891a3231ae8ac47392b (diff)
Replaced Mock_Core_Lang with PHPUnit mockups
Signed-off-by: dchill42 <dchill42@gmail.com>
Diffstat (limited to 'tests/codeigniter/libraries')
-rw-r--r--tests/codeigniter/libraries/Calendar_test.php13
-rw-r--r--tests/codeigniter/libraries/Upload_test.php3
2 files changed, 7 insertions, 9 deletions
diff --git a/tests/codeigniter/libraries/Calendar_test.php b/tests/codeigniter/libraries/Calendar_test.php
index 95668d70d..952e8a8d2 100644
--- a/tests/codeigniter/libraries/Calendar_test.php
+++ b/tests/codeigniter/libraries/Calendar_test.php
@@ -2,12 +2,12 @@
class Calendar_test extends CI_TestCase {
- function __construct()
+ function set_up()
{
- $obj = new stdClass;
- $obj->calendar = new Mock_Libraries_Calendar();
-
- $this->calendar = $obj->calendar;
+ $lang = $this->getMock('CI_Lang', array('load', 'line'));
+ $lang->expects($this->any())->method('line')->will($this->returnValue(FALSE));
+ $this->ci_instance_var('lang', $lang);
+ $this->calendar = new CI_Calendar();
}
function test_initialize()
@@ -20,9 +20,6 @@ class Calendar_test extends CI_TestCase {
$this->assertEquals('monday', $this->calendar->start_day);
}
- /**
- * @covers Mock_Libraries_Calendar::parse_template
- */
function test_generate()
{
$no_events = '<table border="0" cellpadding="4" cellspacing="0">
diff --git a/tests/codeigniter/libraries/Upload_test.php b/tests/codeigniter/libraries/Upload_test.php
index 546cebc59..1bd8f1430 100644
--- a/tests/codeigniter/libraries/Upload_test.php
+++ b/tests/codeigniter/libraries/Upload_test.php
@@ -7,7 +7,8 @@ class Upload_test extends CI_TestCase {
$ci = $this->ci_instance();
$ci->upload = new Mock_Libraries_Upload();
$ci->security = new Mock_Core_Security();
- $ci->lang = new Mock_Core_Lang();
+ $ci->lang = $this->getMock('CI_Lang', array('load', 'line'));
+ $ci->lang->expects($this->any())->method('line')->will($this->returnValue(FALSE));
$this->upload = $ci->upload;
}