Fixed issue with including including PHPUnit's Autoload script. #1174

Merged
merged 6 commits into from Mar 14, 2013

Conversation

Projects
None yet
3 participants
@psparrow
Contributor

psparrow commented Mar 13, 2013

This pull request makes two small changes to CakeTestSuiteDispatcher::loadTestFramework().

First, it resolves any issues with vendor paths ending with a DS character by stripping the character from the end of the vendor path and only adding it where necessary.

Second, it now returns TRUE or FALSE instead of the return value from PHPUnit/Autoload.php. PHPUnit/Autoload.php returns NULL when included successfully, which causes the result to be treated as a false value in CakeTestSuiteDispatcher::_checkPHPUnit().

+
+ protected function clearPaths() {
+ App::build(array('Vendor' => array('junk')), App::RESET);
+ ini_set('include_path', 'junk');

This comment has been minimized.

Show comment Hide comment
@markstory

markstory Mar 13, 2013

Owner

This will destroy an application include_paths.

@markstory

markstory Mar 13, 2013

Owner

This will destroy an application include_paths.

This comment has been minimized.

Show comment Hide comment
@psparrow

psparrow Mar 13, 2013

Contributor

What if we restore them in the tearDown() of the test? I wanted to find a way to test the failure of including PHPUnit.

@psparrow

psparrow Mar 13, 2013

Contributor

What if we restore them in the tearDown() of the test? I wanted to find a way to test the failure of including PHPUnit.

+ $this->includePath = ini_get('include_path');
+ }
+
+ public function tearDown() {

This comment has been minimized.

Show comment Hide comment
@psparrow

psparrow Mar 13, 2013

Contributor

Added code to restore the include_path and vendor paths.

@psparrow

psparrow Mar 13, 2013

Contributor

Added code to restore the include_path and vendor paths.

+
+ try {
+ $dispatcher->loadTestFramework();
+ } catch(Exception $ex) {

This comment has been minimized.

Show comment Hide comment
@markstory

markstory Mar 13, 2013

Owner

Should be } catch (.

@markstory

markstory Mar 13, 2013

Owner

Should be } catch (.

+
+ try {
+ $dispatcher->loadTestFramework();
+ } catch (Exception $ex) {

This comment has been minimized.

Show comment Hide comment
@psparrow

psparrow Mar 14, 2013

Contributor

I fixed the code formatting. Anything else?

@psparrow

psparrow Mar 14, 2013

Contributor

I fixed the code formatting. Anything else?

markstory added a commit that referenced this pull request Mar 14, 2013

Merge pull request #1174 from psparrow/master
Fixed issue with including including PHPUnit's Autoload script.

@markstory markstory merged commit 76ea080 into cakephp:master Mar 14, 2013

@ceeram

This comment has been minimized.

Show comment Hide comment
@ceeram

ceeram Mar 18, 2013

Member

The newly added file does not follow cakephp coding conventions, phpcs fails, spaces were used for indenting. CakePHP uses tabs for indenting.

Member

ceeram commented Mar 18, 2013

The newly added file does not follow cakephp coding conventions, phpcs fails, spaces were used for indenting. CakePHP uses tabs for indenting.

@ceeram

This comment has been minimized.

Show comment Hide comment
@ceeram

ceeram Mar 18, 2013

Member

Fixed coding standards: 89100f9

Member

ceeram commented Mar 18, 2013

Fixed coding standards: 89100f9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment