summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/core
diff options
context:
space:
mode:
authorEric Barnes <eric@ericlbarnes.com>2011-04-22 04:00:33 +0200
committerEric Barnes <eric@ericlbarnes.com>2011-04-22 04:00:33 +0200
commit68286a4dcc1ed4d904ad992173c1b3621bf6fced (patch)
treedd24a9e0126058f9d3b0958244b85784f1a66223 /tests/codeigniter/core
parentb58aeaca9be4b342bb6d88138005fdc7138828b4 (diff)
Reworked unit tests to match rest of framework and added a few more.
Diffstat (limited to 'tests/codeigniter/core')
-rw-r--r--tests/codeigniter/core/Common_test.php16
-rw-r--r--tests/codeigniter/core/Config_test.php12
-rw-r--r--tests/codeigniter/core/Lang_test.php6
-rw-r--r--tests/codeigniter/core/Loader_test.php28
4 files changed, 39 insertions, 23 deletions
diff --git a/tests/codeigniter/core/Common_test.php b/tests/codeigniter/core/Common_test.php
new file mode 100644
index 000000000..cec12982d
--- /dev/null
+++ b/tests/codeigniter/core/Common_test.php
@@ -0,0 +1,16 @@
+<?php
+
+require_once(BASEPATH.'helpers/email_helper.php');
+
+class Common_test extends CI_TestCase
+{
+
+ // ------------------------------------------------------------------------
+
+ public function test_is_php()
+ {
+ $this->assertEquals(TRUE, is_php('1.2.0'));
+ $this->assertEquals(FALSE, is_php('9999.9.9'));
+ }
+
+} \ No newline at end of file
diff --git a/tests/codeigniter/core/Config_test.php b/tests/codeigniter/core/Config_test.php
index b04dd67fa..b6c57da70 100644
--- a/tests/codeigniter/core/Config_test.php
+++ b/tests/codeigniter/core/Config_test.php
@@ -2,7 +2,7 @@
class Config_test extends CI_TestCase {
- public function setUp()
+ public function set_up()
{
$cls =& $this->ci_core_class('cfg');
@@ -18,7 +18,7 @@ class Config_test extends CI_TestCase {
// --------------------------------------------------------------------
- public function testItem()
+ public function test_item()
{
$this->assertEquals('http://example.com/', $this->config->item('base_url'));
@@ -32,7 +32,7 @@ class Config_test extends CI_TestCase {
// --------------------------------------------------------------------
- public function testSetItem()
+ public function test_set_item()
{
$this->assertFalse($this->config->item('not_yet_set'));
@@ -43,7 +43,7 @@ class Config_test extends CI_TestCase {
// --------------------------------------------------------------------
- public function testSlashItem()
+ public function test_slash_item()
{
// Bad Config value
$this->assertFalse($this->config->slash_item('no_good_item'));
@@ -55,7 +55,7 @@ class Config_test extends CI_TestCase {
// --------------------------------------------------------------------
- public function testSiteUrl()
+ public function test_site_url()
{
$this->assertEquals('http://example.com/index.php', $this->config->site_url());
@@ -85,7 +85,7 @@ class Config_test extends CI_TestCase {
// --------------------------------------------------------------------
- public function testSystemUrl()
+ public function test_system_url()
{
$this->assertEquals('http://example.com/system/', $this->config->system_url());
}
diff --git a/tests/codeigniter/core/Lang_test.php b/tests/codeigniter/core/Lang_test.php
index f65b335b0..dcc3d0879 100644
--- a/tests/codeigniter/core/Lang_test.php
+++ b/tests/codeigniter/core/Lang_test.php
@@ -4,7 +4,7 @@ class Lang_test extends CI_TestCase {
protected $lang;
- public function setUp()
+ public function set_up()
{
$cls = $this->ci_core_class('lang');
$this->lang = new $cls;
@@ -12,7 +12,7 @@ class Lang_test extends CI_TestCase {
// --------------------------------------------------------------------
- public function testLoad()
+ public function test_load()
{
// get_config needs work
$this->markTestIncomplete('get_config needs work');
@@ -21,7 +21,7 @@ class Lang_test extends CI_TestCase {
// --------------------------------------------------------------------
- public function testLine()
+ public function test_line()
{
$this->markTestIncomplete('get_config needs work');
diff --git a/tests/codeigniter/core/Loader_test.php b/tests/codeigniter/core/Loader_test.php
index 49679e241..9ba870b7d 100644
--- a/tests/codeigniter/core/Loader_test.php
+++ b/tests/codeigniter/core/Loader_test.php
@@ -37,7 +37,7 @@ class Loader_test extends CI_TestCase {
private $ci_obj;
- public function setUp()
+ public function set_up()
{
// Instantiate a new loader
$this->load = new Extended_Loader();
@@ -51,7 +51,7 @@ class Loader_test extends CI_TestCase {
// --------------------------------------------------------------------
- public function testLibrary()
+ public function test_library()
{
$this->_setup_config_mock();
@@ -69,7 +69,7 @@ class Loader_test extends CI_TestCase {
// --------------------------------------------------------------------
- public function testLoadLibraryInApplicationDir()
+ public function test_load_library_in_application_dir()
{
$this->_setup_config_mock();
@@ -101,7 +101,7 @@ class Loader_test extends CI_TestCase {
// --------------------------------------------------------------------
- public function testNonExistentModel()
+ public function test_non_existent_model()
{
$this->setExpectedException(
'Exception',
@@ -116,7 +116,7 @@ class Loader_test extends CI_TestCase {
/**
* @coverts CI_Loader::model
*/
- public function testModels()
+ public function test_models()
{
$this->ci_set_core_class('model', 'CI_Model');
@@ -147,7 +147,7 @@ class Loader_test extends CI_TestCase {
/**
* @coverts CI_Loader::view
*/
- public function testLoadView()
+ public function test_load_view()
{
$this->ci_set_core_class('output', 'CI_Output');
@@ -158,7 +158,7 @@ class Loader_test extends CI_TestCase {
// Use the optional return parameter in this test, so the view is not
// run through the output class.
$this->assertEquals('This is my test page. World!',
- $this->load->view('unit_test_view', array('hello' => "World!"), TRUE));
+ $this->load->view('unit_test_view', array('hello' => "World!"), TRUE));
}
@@ -167,7 +167,7 @@ class Loader_test extends CI_TestCase {
/**
* @coverts CI_Loader::view
*/
- public function testNonExistentView()
+ public function test_non_existent_view()
{
$this->setExpectedException(
'Exception',
@@ -179,7 +179,7 @@ class Loader_test extends CI_TestCase {
// --------------------------------------------------------------------
- public function testFile()
+ public function test_file()
{
$content = 'Here is a test file, which we will load now.';
$file = vfsStream::newFile('ci_test_mock_file.php')->withContent($content)
@@ -202,7 +202,7 @@ class Loader_test extends CI_TestCase {
// --------------------------------------------------------------------
- public function testVars()
+ public function test_vars()
{
$vars = array(
'foo' => 'bar'
@@ -214,7 +214,7 @@ class Loader_test extends CI_TestCase {
// --------------------------------------------------------------------
- public function testHelper()
+ public function test_helper()
{
$this->assertEquals(NULL, $this->load->helper('array'));
@@ -228,7 +228,7 @@ class Loader_test extends CI_TestCase {
// --------------------------------------------------------------------
- public function testLoadingMultipleHelpers()
+ public function test_loading_multiple_helpers()
{
$this->assertEquals(NULL, $this->load->helpers(array('file', 'array', 'string')));
}
@@ -242,7 +242,7 @@ class Loader_test extends CI_TestCase {
// --------------------------------------------------------------------
- public function testLoadConfig()
+ public function test_load_config()
{
$this->_setup_config_mock();
@@ -251,7 +251,7 @@ class Loader_test extends CI_TestCase {
// --------------------------------------------------------------------
- public function testLoadBadConfig()
+ public function test_load_bad_config()
{
$this->_setup_config_mock();