@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Test Suite Provider for NetBeans |
|
4 | - * https://github.com/BrickieToolShed/netbeans-phpunit-support |
|
5 | - * |
|
6 | - * Modified 2015 by Kenji Suzuki <https://github.com/kenjis> |
|
7 | - * @link https://github.com/kenjis/ci-phpunit-test |
|
8 | - */ |
|
3 | + * Test Suite Provider for NetBeans |
|
4 | + * https://github.com/BrickieToolShed/netbeans-phpunit-support |
|
5 | + * |
|
6 | + * Modified 2015 by Kenji Suzuki <https://github.com/kenjis> |
|
7 | + * @link https://github.com/kenjis/ci-phpunit-test |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ |
11 | 11 | /** |
@@ -52,71 +52,71 @@ discard block |
||
52 | 52 | */ |
53 | 53 | final class TestSuiteProvider |
54 | 54 | { |
55 | - /** |
|
56 | - * phpunit configuration file |
|
57 | - * |
|
58 | - * @var string |
|
59 | - */ |
|
60 | - private static $file; |
|
55 | + /** |
|
56 | + * phpunit configuration file |
|
57 | + * |
|
58 | + * @var string |
|
59 | + */ |
|
60 | + private static $file; |
|
61 | 61 | |
62 | - /** |
|
63 | - * constructor |
|
64 | - */ |
|
65 | - private function __construct() {} |
|
62 | + /** |
|
63 | + * constructor |
|
64 | + */ |
|
65 | + private function __construct() {} |
|
66 | 66 | |
67 | - /** |
|
68 | - * set the phpunit configuration file |
|
69 | - * |
|
70 | - * @param string $file the path or filename of the phunit configuration file |
|
71 | - */ |
|
72 | - public static function setConfigurationFile($file) |
|
73 | - { |
|
74 | - static::$file = $file; |
|
75 | - } |
|
67 | + /** |
|
68 | + * set the phpunit configuration file |
|
69 | + * |
|
70 | + * @param string $file the path or filename of the phunit configuration file |
|
71 | + */ |
|
72 | + public static function setConfigurationFile($file) |
|
73 | + { |
|
74 | + static::$file = $file; |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * get the phpunit test suite instance |
|
79 | - * |
|
80 | - * @return PHPUnit_Framework_TestSuite returns the phpunit test suite instance |
|
81 | - * @throws FileNotFoundException if the file is not found |
|
82 | - */ |
|
83 | - public static function suite() |
|
84 | - { |
|
85 | - $file = static::checkConfigurationFile( |
|
86 | - static::getConfigurationFile() |
|
87 | - ); |
|
77 | + /** |
|
78 | + * get the phpunit test suite instance |
|
79 | + * |
|
80 | + * @return PHPUnit_Framework_TestSuite returns the phpunit test suite instance |
|
81 | + * @throws FileNotFoundException if the file is not found |
|
82 | + */ |
|
83 | + public static function suite() |
|
84 | + { |
|
85 | + $file = static::checkConfigurationFile( |
|
86 | + static::getConfigurationFile() |
|
87 | + ); |
|
88 | 88 | |
89 | - return PHPUnit_Util_Configuration::getInstance($file) |
|
90 | - ->getTestSuiteConfiguration(); |
|
91 | - } |
|
89 | + return PHPUnit_Util_Configuration::getInstance($file) |
|
90 | + ->getTestSuiteConfiguration(); |
|
91 | + } |
|
92 | 92 | |
93 | - /** |
|
94 | - * get the phpunit configuration file |
|
95 | - * |
|
96 | - * @return string |
|
97 | - */ |
|
98 | - private static function getConfigurationFile() |
|
99 | - { |
|
100 | - static::$file = isset(static::$file) |
|
101 | - ? static::$file |
|
102 | - : APPPATH.'tests/phpunit.xml'; |
|
93 | + /** |
|
94 | + * get the phpunit configuration file |
|
95 | + * |
|
96 | + * @return string |
|
97 | + */ |
|
98 | + private static function getConfigurationFile() |
|
99 | + { |
|
100 | + static::$file = isset(static::$file) |
|
101 | + ? static::$file |
|
102 | + : APPPATH.'tests/phpunit.xml'; |
|
103 | 103 | |
104 | - return static::$file; |
|
105 | - } |
|
104 | + return static::$file; |
|
105 | + } |
|
106 | 106 | |
107 | - /** |
|
108 | - * check the given file |
|
109 | - * |
|
110 | - * @param string $file file to check |
|
111 | - * @return string returns the file if it is valid |
|
112 | - * @throws FileNotFoundException if the file is not found |
|
113 | - */ |
|
114 | - private static function checkConfigurationFile($file) |
|
115 | - { |
|
116 | - if (!file_exists($file)) { |
|
117 | - throw new \RuntimeException("The requested phpunit configuration was not found at $file"); |
|
118 | - } |
|
107 | + /** |
|
108 | + * check the given file |
|
109 | + * |
|
110 | + * @param string $file file to check |
|
111 | + * @return string returns the file if it is valid |
|
112 | + * @throws FileNotFoundException if the file is not found |
|
113 | + */ |
|
114 | + private static function checkConfigurationFile($file) |
|
115 | + { |
|
116 | + if (!file_exists($file)) { |
|
117 | + throw new \RuntimeException("The requested phpunit configuration was not found at $file"); |
|
118 | + } |
|
119 | 119 | |
120 | - return $file; |
|
121 | - } |
|
120 | + return $file; |
|
121 | + } |
|
122 | 122 | } |
@@ -113,7 +113,7 @@ |
||
113 | 113 | */ |
114 | 114 | private static function checkConfigurationFile($file) |
115 | 115 | { |
116 | - if (!file_exists($file)) { |
|
116 | + if ( ! file_exists($file)) { |
|
117 | 117 | throw new \RuntimeException("The requested phpunit configuration was not found at $file"); |
118 | 118 | } |
119 | 119 |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Part of CI PHPUnit Test |
|
4 | - * |
|
5 | - * @author Kenji Suzuki <https://github.com/kenjis> |
|
6 | - * @license MIT License |
|
7 | - * @copyright 2015 Kenji Suzuki |
|
8 | - * @link https://github.com/kenjis/ci-phpunit-test |
|
9 | - */ |
|
3 | + * Part of CI PHPUnit Test |
|
4 | + * |
|
5 | + * @author Kenji Suzuki <https://github.com/kenjis> |
|
6 | + * @license MIT License |
|
7 | + * @copyright 2015 Kenji Suzuki |
|
8 | + * @link https://github.com/kenjis/ci-phpunit-test |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | require __DIR__ . '/Installer.php'; |
12 | 12 |
@@ -31,27 +31,27 @@ discard block |
||
31 | 31 | self::$autoload_dirs = $autoload_dirs; |
32 | 32 | |
33 | 33 | // Load autoloader for ci-phpunit-test |
34 | - require __DIR__ . '/autoloader.php'; |
|
34 | + require __DIR__.'/autoloader.php'; |
|
35 | 35 | |
36 | 36 | // Autoloader for PHP-Parser |
37 | 37 | // Don't use `require`, because we may have required already |
38 | 38 | // in `patcher/bootstrap.php` |
39 | - require_once __DIR__ . '/patcher/third_party/PHP-Parser/lib/bootstrap.php'; |
|
39 | + require_once __DIR__.'/patcher/third_party/PHP-Parser/lib/bootstrap.php'; |
|
40 | 40 | |
41 | - require APPPATH . '/tests/TestCase.php'; |
|
41 | + require APPPATH.'/tests/TestCase.php'; |
|
42 | 42 | |
43 | 43 | // Replace a few Common functions |
44 | - require __DIR__ . '/replacing/core/Common.php'; |
|
45 | - require BASEPATH . 'core/Common.php'; |
|
44 | + require __DIR__.'/replacing/core/Common.php'; |
|
45 | + require BASEPATH.'core/Common.php'; |
|
46 | 46 | |
47 | 47 | // Workaround for missing CodeIgniter's error handler |
48 | 48 | // See https://github.com/kenjis/ci-phpunit-test/issues/37 |
49 | 49 | set_error_handler('_error_handler'); |
50 | 50 | |
51 | 51 | // Load new functions of CIPHPUnitTest |
52 | - require __DIR__ . '/functions.php'; |
|
52 | + require __DIR__.'/functions.php'; |
|
53 | 53 | // Load ci-phpunit-test CI_Loader |
54 | - require __DIR__ . '/replacing/core/Loader.php'; |
|
54 | + require __DIR__.'/replacing/core/Loader.php'; |
|
55 | 55 | |
56 | 56 | // Change current directroy |
57 | 57 | chdir(FCPATH); |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | * |
64 | 64 | * And away we go... |
65 | 65 | */ |
66 | - require __DIR__ . '/replacing/core/CodeIgniter.php'; |
|
66 | + require __DIR__.'/replacing/core/CodeIgniter.php'; |
|
67 | 67 | |
68 | 68 | self::replaceHelpers(); |
69 | 69 | |
70 | 70 | // Create CodeIgniter instance |
71 | - if (! self::wiredesignzHmvcInstalled()) |
|
71 | + if ( ! self::wiredesignzHmvcInstalled()) |
|
72 | 72 | { |
73 | 73 | new CI_Controller(); |
74 | 74 | } |
@@ -102,11 +102,11 @@ discard block |
||
102 | 102 | protected static function replaceLoader() |
103 | 103 | { |
104 | 104 | $my_loader_file = |
105 | - APPPATH . 'core/' . config_item('subclass_prefix') . 'Loader.php'; |
|
105 | + APPPATH.'core/'.config_item('subclass_prefix').'Loader.php'; |
|
106 | 106 | |
107 | 107 | if (file_exists($my_loader_file)) |
108 | 108 | { |
109 | - self::$loader_class = config_item('subclass_prefix') . 'Loader'; |
|
109 | + self::$loader_class = config_item('subclass_prefix').'Loader'; |
|
110 | 110 | if ( ! class_exists(self::$loader_class)) |
111 | 111 | { |
112 | 112 | require $my_loader_file; |
@@ -117,19 +117,19 @@ discard block |
||
117 | 117 | |
118 | 118 | protected static function replaceHelpers() |
119 | 119 | { |
120 | - $my_helper_file = APPPATH . 'helpers/' . config_item('subclass_prefix') . 'url_helper.php'; |
|
120 | + $my_helper_file = APPPATH.'helpers/'.config_item('subclass_prefix').'url_helper.php'; |
|
121 | 121 | if (file_exists($my_helper_file)) |
122 | 122 | { |
123 | 123 | require $my_helper_file; |
124 | 124 | } |
125 | - require __DIR__ . '/replacing/helpers/url_helper.php'; |
|
125 | + require __DIR__.'/replacing/helpers/url_helper.php'; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | public static function setPatcherCacheDir($dir = null) |
129 | 129 | { |
130 | 130 | if ($dir === null) |
131 | 131 | { |
132 | - $dir = APPPATH . 'tests/_ci_phpunit_test/tmp/cache'; |
|
132 | + $dir = APPPATH.'tests/_ci_phpunit_test/tmp/cache'; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | MonkeyPatchManager::setCacheDir( |
@@ -38,8 +38,7 @@ |
||
38 | 38 | { |
39 | 39 | $patched = true; |
40 | 40 | $new_source = static::generateNewSource($source); |
41 | - } |
|
42 | - else |
|
41 | + } else |
|
43 | 42 | { |
44 | 43 | $new_source = $source; |
45 | 44 | } |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Part of CI PHPUnit Test |
|
4 | - * |
|
5 | - * @author Kenji Suzuki <https://github.com/kenjis> |
|
6 | - * @license MIT License |
|
7 | - * @copyright 2015 Kenji Suzuki |
|
8 | - * @link https://github.com/kenjis/ci-phpunit-test |
|
9 | - */ |
|
3 | + * Part of CI PHPUnit Test |
|
4 | + * |
|
5 | + * @author Kenji Suzuki <https://github.com/kenjis> |
|
6 | + * @license MIT License |
|
7 | + * @copyright 2015 Kenji Suzuki |
|
8 | + * @link https://github.com/kenjis/ci-phpunit-test |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | require __DIR__ . '/Installer.php'; |
12 | 12 |