diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/codeigniter/database/query_builder/insert_test.php | 8 | ||||
-rw-r--r-- | tests/mocks/autoloader.php | 8 | ||||
-rw-r--r-- | tests/mocks/database/drivers/sqlite.php | 2 | ||||
-rw-r--r-- | tests/phpunit.xml | 25 |
4 files changed, 34 insertions, 9 deletions
diff --git a/tests/codeigniter/database/query_builder/insert_test.php b/tests/codeigniter/database/query_builder/insert_test.php index 8ba60e242..a9aafb66e 100644 --- a/tests/codeigniter/database/query_builder/insert_test.php +++ b/tests/codeigniter/database/query_builder/insert_test.php @@ -26,7 +26,7 @@ class Insert_test extends CI_TestCase { public function test_insert() { $job_data = array('id' => 1, 'name' => 'Grocery Sales', 'description' => 'Discount!'); - + // Do normal insert $this->assertTrue($this->db->insert('job', $job_data)); @@ -45,10 +45,10 @@ class Insert_test extends CI_TestCase { public function test_insert_batch() { $job_datas = array( - array('id' => 2, 'name' => 'Commedian', 'description' => 'Theres something in your teeth'), + array('id' => 2, 'name' => 'Commedian', 'description' => 'Theres something in your teeth'), array('id' => 3, 'name' => 'Cab Driver', 'description' => 'Iam yellow'), ); - + // Do insert batch except for sqlite driver if (strpos(DB_DRIVER, 'sqlite') === FALSE) { @@ -62,5 +62,5 @@ class Insert_test extends CI_TestCase { $this->assertEquals('Cab Driver', $job_3->name); } } - + }
\ No newline at end of file diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php index ff2196d4e..90aabcbe6 100644 --- a/tests/mocks/autoloader.php +++ b/tests/mocks/autoloader.php @@ -7,9 +7,9 @@ // Prototype : // // $mock_table = new Mock_Libraries_Table(); // Will load ./mocks/libraries/table.php -// $mock_database_driver = new Mock_Database_Driver(); // Will load ./mocks/database/driver.php +// $mock_database_driver = new Mock_Database_Driver(); // Will load ./mocks/database/driver.php // and so on... -function autoload($class) +function autoload($class) { $dir = realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR; @@ -75,13 +75,13 @@ function autoload($class) { $trace = debug_backtrace(); - // If the autoload call came from `class_exists` or `file_exists`, + // If the autoload call came from `class_exists` or `file_exists`, // we skipped and return FALSE if ($trace[2]['function'] === 'class_exists' OR $trace[2]['function'] === 'file_exists') { return FALSE; } - + throw new InvalidArgumentException("Unable to load $class."); } diff --git a/tests/mocks/database/drivers/sqlite.php b/tests/mocks/database/drivers/sqlite.php index 76a182cbf..15cefbf53 100644 --- a/tests/mocks/database/drivers/sqlite.php +++ b/tests/mocks/database/drivers/sqlite.php @@ -1,7 +1,7 @@ <?php class Mock_Database_Drivers_Sqlite extends Mock_Database_DB_Driver { - + /** * Instantiate the database driver * diff --git a/tests/phpunit.xml b/tests/phpunit.xml new file mode 100644 index 000000000..56cb8841c --- /dev/null +++ b/tests/phpunit.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<phpunit + bootstrap="./Bootstrap.php" + colors="true" + convertNoticesToExceptions="true" + convertWarningsToExceptions="true" + stopOnError="false" + stopOnFailure="false" + stopOnIncomplete="false" + stopOnSkipped="false"> + <testsuites> + <testsuite name="CodeIgniter Core Test Suite"> + <directory suffix="test.php">./codeigniter/core</directory> + <directory suffix="test.php">./codeigniter/helpers</directory> + <directory suffix="test.php">./codeigniter/libraries</directory> + </testsuite> + </testsuites> + <filters> + <blacklist> + <directory suffix=".php">PEAR_INSTALL_DIR</directory> + <directory suffix=".php">PHP_LIBDIR</directory> + </blacklist> + </filters> +</phpunit>
\ No newline at end of file |