Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added missing PHPUnit bootstrap class and configuration file.

  • Loading branch information...
commit 7fdb4a776b54aa870675fef654b6ea5c7d8219c8 1 parent 4ea3c60
Emran Hasan authored

Showing 2 changed files with 102 additions and 0 deletions. Show diff stats Hide diff stats

  1. +92 0 tests/bootstrap.php
  2. +10 0 tests/phpunit.xml
92 tests/bootstrap.php
... ... @@ -0,0 +1,92 @@
  1 +<?php
  2 +
  3 +define('ENVIRONMENT', 'testing');
  4 +
  5 +$system_path = '../system';
  6 +$application_folder = '../application';
  7 +$view_folder = '';
  8 +
  9 +/*
  10 + * ---------------------------------------------------------------
  11 + * Resolve the system path for increased reliability
  12 + * ---------------------------------------------------------------
  13 + */
  14 +
  15 +// Set the current directory correctly for CLI requests
  16 +if (defined('STDIN')) {
  17 + chdir(dirname(__FILE__));
  18 +}
  19 +
  20 +if (realpath($system_path) !== FALSE) {
  21 + $system_path = realpath($system_path) . '/';
  22 +}
  23 +
  24 +// ensure there's a trailing slash
  25 +$system_path = rtrim($system_path, '/') . '/';
  26 +
  27 +// Is the system path correct?
  28 +if (!is_dir($system_path)) {
  29 + exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: " . pathinfo(__FILE__, PATHINFO_BASENAME));
  30 +}
  31 +
  32 +/*
  33 + * -------------------------------------------------------------------
  34 + * Now that we know the path, set the main path constants
  35 + * -------------------------------------------------------------------
  36 + */
  37 +// The name of THIS file
  38 +define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
  39 +
  40 +// The PHP file extension
  41 +// this global constant is deprecated.
  42 +define('EXT', '.php');
  43 +
  44 +// Path to the system folder
  45 +define('BASEPATH', str_replace("\\", "/", $system_path));
  46 +
  47 +// Path to the front controller (this file)
  48 +define('FCPATH', str_replace(SELF, '', __FILE__));
  49 +
  50 +// Name of the "system folder"
  51 +define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
  52 +
  53 +
  54 +// The path to the "application" folder
  55 +if (is_dir($application_folder)) {
  56 + define('APPPATH', $application_folder . '/');
  57 +}
  58 +else
  59 +{
  60 + if (!is_dir(BASEPATH . $application_folder . '/')) {
  61 + exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: " . SELF);
  62 + }
  63 +
  64 + define('APPPATH', BASEPATH . $application_folder . '/');
  65 +}
  66 +
  67 +// The path to the "views" folder
  68 +if (is_dir($view_folder)) {
  69 + define ('VIEWPATH', $view_folder . '/');
  70 +}
  71 +else
  72 +{
  73 + if (!is_dir(APPPATH . 'views/')) {
  74 + exit("Your view folder path does not appear to be set correctly. Please open the following file and correct this: " . SELF);
  75 + }
  76 +
  77 + define ('VIEWPATH', APPPATH . 'views/');
  78 +}
  79 +error_reporting(-1);
  80 +
  81 +/*
  82 + * --------------------------------------------------------------------
  83 + * LOAD THE BOOTSTRAP FILE
  84 + * --------------------------------------------------------------------
  85 + *
  86 + * And away we go...
  87 + *
  88 + */
  89 +require_once BASEPATH . 'core/CodeIgniter.php';
  90 +
  91 +/* End of file index.php */
  92 +/* Location: ./index.php */
10 tests/phpunit.xml
... ... @@ -0,0 +1,10 @@
  1 +<phpunit bootstrap="bootstrap.php"
  2 + colors="true"
  3 + convertErrorsToExceptions="true"
  4 + convertNoticesToExceptions="true"
  5 + convertWarningsToExceptions="true"
  6 + processIsolation="false"
  7 + stopOnFailure="false"
  8 + syntaxCheck="false"
  9 + verbose="true">
  10 +</phpunit>

0 comments on commit 7fdb4a7

Please sign in to comment.
Something went wrong with that request. Please try again.