diff --git a/tests/codeigniter/core/Loader_test.php b/tests/codeigniter/core/Loader_test.php index 45c50ac263d..bf653208e29 100644 --- a/tests/codeigniter/core/Loader_test.php +++ b/tests/codeigniter/core/Loader_test.php @@ -322,7 +322,7 @@ public function test_load_view() $this->assertEquals($content.'undefined', $out); // Mock output class - $output = $this->getMockBuilder('CI_Output')->setMethods(array('append_output'))->getMock(); + $output = $this->getMockBuilder('CI_Output')->onlyMethods(array('append_output'))->getMock(); $output->expects($this->once())->method('append_output')->with($content.$value); $this->ci_instance_var('output', $output); @@ -483,7 +483,7 @@ public function test_language() { // Mock lang class and test load call $file = 'test'; - $lang = $this->getMockBuilder('CI_Lang')->setMethods(array('load'))->getMock(); + $lang = $this->getMockBuilder('CI_Lang')->onlyMethods(array('load'))->getMock(); $lang->expects($this->once())->method('load')->with($file); $this->ci_instance_var('lang', $lang); $this->assertInstanceOf('CI_Loader', $this->load->language($file)); diff --git a/tests/codeigniter/helpers/language_helper_test.php b/tests/codeigniter/helpers/language_helper_test.php index 1ddabea3d6b..ccb22bab669 100644 --- a/tests/codeigniter/helpers/language_helper_test.php +++ b/tests/codeigniter/helpers/language_helper_test.php @@ -5,7 +5,7 @@ class Language_helper_test extends CI_TestCase { public function test_lang() { $this->helper('language'); - $lang = $this->getMockBuilder('CI_Lang')->setMethods(array('line'))->getMock(); + $lang = $this->getMockBuilder('CI_Lang')->onlyMethods(array('line'))->getMock(); $lang->expects($this->any())->method('line')->will($this->returnValue(FALSE)); $this->ci_instance_var('lang', $lang); diff --git a/tests/codeigniter/helpers/number_helper_test.php b/tests/codeigniter/helpers/number_helper_test.php index 663e354fef3..7aa27776028 100644 --- a/tests/codeigniter/helpers/number_helper_test.php +++ b/tests/codeigniter/helpers/number_helper_test.php @@ -11,7 +11,7 @@ public function set_up() // Mock away load, too much going on in there, // we'll just check for the expected parameter - $lang = $this->getMockBuilder('CI_Lang')->setMethods(array('load'))->getMock(); + $lang = $this->getMockBuilder('CI_Lang')->onlyMethods(array('load'))->getMock(); $lang->expects($this->once()) ->method('load') ->with($this->equalTo('number')); diff --git a/tests/codeigniter/libraries/Calendar_test.php b/tests/codeigniter/libraries/Calendar_test.php index ad1f45e8c77..afbad19648b 100644 --- a/tests/codeigniter/libraries/Calendar_test.php +++ b/tests/codeigniter/libraries/Calendar_test.php @@ -5,9 +5,9 @@ class Calendar_test extends CI_TestCase { public function set_up() { // Required for get_total_days() - $this->ci_instance_var('load', $this->getMockBuilder('CI_Loader')->setMethods(array('helper'))->getMock()); + $this->ci_instance_var('load', $this->getMockBuilder('CI_Loader')->onlyMethods(array('helper'))->getMock()); - $lang = $this->getMockBuilder('CI_Lang')->setMethods(array('load', 'line'))->getMock(); + $lang = $this->getMockBuilder('CI_Lang')->onlyMethods(array('load', 'line'))->getMock(); $lang->expects($this->any())->method('line')->will($this->returnValue(FALSE)); $this->ci_instance_var('lang', $lang); diff --git a/tests/codeigniter/libraries/Driver_test.php b/tests/codeigniter/libraries/Driver_test.php index 5089bb851e1..8070a252268 100644 --- a/tests/codeigniter/libraries/Driver_test.php +++ b/tests/codeigniter/libraries/Driver_test.php @@ -18,7 +18,7 @@ public function set_up() // Mock Loader->get_package_paths $paths = 'get_package_paths'; - $ldr = $this->getMockBuilder('CI_Loader')->setMethods(array($paths))->getMock(); + $ldr = $this->getMockBuilder('CI_Loader')->onlyMethods(array($paths))->getMock(); $ldr->expects($this->any())->method($paths)->will($this->returnValue(array(APPPATH, BASEPATH))); $this->ci_instance_var('load', $ldr); diff --git a/tests/codeigniter/libraries/Form_validation_test.php b/tests/codeigniter/libraries/Form_validation_test.php index 1bafd50c350..f48f20331de 100644 --- a/tests/codeigniter/libraries/Form_validation_test.php +++ b/tests/codeigniter/libraries/Form_validation_test.php @@ -8,10 +8,10 @@ public function set_up() // Create a mock loader since load->helper() looks in the wrong directories for unit tests, // We'll use CI_TestCase->helper() instead - $loader = $this->getMockBuilder('CI_Loader')->setMethods(array('helper'))->getMock(); + $loader = $this->getMockBuilder('CI_Loader')->onlyMethods(array('helper'))->getMock(); // Same applies for lang - $lang = $this->getMockBuilder('CI_Lang')->setMethods(array('load'))->getMock(); + $lang = $this->getMockBuilder('CI_Lang')->onlyMethods(array('load'))->getMock(); $security = new Mock_Core_Security('UTF-8'); $input = new CI_Input($security); diff --git a/tests/codeigniter/libraries/Upload_test.php b/tests/codeigniter/libraries/Upload_test.php index 74a7d2c22df..db6f61c9dbd 100644 --- a/tests/codeigniter/libraries/Upload_test.php +++ b/tests/codeigniter/libraries/Upload_test.php @@ -7,7 +7,7 @@ public function set_up() $ci = $this->ci_instance(); $ci->upload = new CI_Upload(); $ci->security = new Mock_Core_Security('UTF-8'); - $ci->lang = $this->getMockBuilder('CI_Lang')->setMethods(array('load', 'line'))->getMock(); + $ci->lang = $this->getMockBuilder('CI_Lang')->onlyMethods(array('load', 'line'))->getMock(); $ci->lang->expects($this->any())->method('line')->will($this->returnValue(FALSE)); $this->upload = $ci->upload; }