Hyra / PHPUnit-Cake2

PHPUnit files needed to run PHPUnit as standalone in Cake 2.0
http://www.mindthecode.com
21 stars 8 forks source link

rewrite #2

Closed dereuromark closed 13 years ago

dereuromark commented 13 years ago

the extraction process runs smoothly. but I am not convinced yet the folder stucture is correct if you look at the autoload.php file, they should be in folders like "PHPUnit", "PHP", "File", ...

and only if they are, PHPUnit works for me out of the box. is there a reason why do didnt apply this folder structure?

dereuromark commented 13 years ago

never mind. I added the folder variable and it the folder structure looks good :)

but it seems files are missing: "require_once(PHPUnit/Framework/MockObject/Autoload.php)"

dereuromark commented 13 years ago

Oh jesus.. seems like we got another problem: http://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/2314-folder-class-should-merge-by-default#ticket-2314-2

Hyra commented 13 years ago

Ah, was gonna say .. the Folder structure looks alright.

About the require_once .. this would help:

    $files = array(
        'PHPUnit/Autoload.php',
        'PHP/CodeCoverage/Filter.php',
        'File/Iterator/Factory.php',
    );
    foreach($files as $file) {
        $to_change = new File('./vendors/'.$file);
        $data = $to_change->read();
        $data = str_replace("require_once '", "require_once ROOT.'/vendors/", $data);
        $to_change->write($data);
    }
dereuromark commented 13 years ago

everything works now :)

Hyra commented 13 years ago

Btw, I actually wrote that bit a while back since I got issues with the require statements not finding the files, but when leaving it out and running the installer it doesn't complain and can find everything just fine, so it's seems obsolete.

You got that warning recently though?

dereuromark commented 13 years ago

no, i dont get any warnings. for me, it now runs smoothly and afterwards the test suite runs, as well.

dereuromark commented 13 years ago

it is not ideal that I had to use the hack from my ticket. hopefully they fix it soon.

Hyra commented 13 years ago

Awesome, so we just have to figure out how to merge all the files within corresponding folders correctly

dereuromark commented 13 years ago

because do dont like my fix? :)

Hyra commented 13 years ago

I can't Auto Merge the pull request, so I copied your version locally and am getting some issues such as:

Notice Error: A non well formed numeric value encountered in [Cake/Console/ConsoleOutput.php, line 167]

Trying to fix them and i'll push it :)

But: Like it a lot!

dereuromark commented 13 years ago

do you use the current head? I never got that notice.

also note that you need to apply my folder class fix in order to achieve the expected result (its linked as comment in the shell).

Hyra commented 13 years ago

It was this line:

$this->out(__('Hi There. To install PHPUnit %s, run `Phpunit.Phpunit install [version]`'), self::PHPUNIT_VERSION);

which should be:

$this->out(__('Hi There. To install PHPUnit %s, run `Phpunit.Phpunit install [version]`', self::PHPUNIT_VERSION));

I updated the repository with your fixes and changes :)

Works fine for me without the linked fix btw .. might be WIN only?

Hyra commented 13 years ago

Updated the repository with your fixes and additions! Works fine without the linked fix for me btw, so might be a WIN only issue?

dereuromark commented 13 years ago

stupid mistake. sry for that. Check if the PHPUnit/Framework/ folder contains "MockObject" folder. If so, this is a WIN only issue

Hyra commented 13 years ago

No problem :)

Yep, the MockObject folder is there.

dereuromark commented 13 years ago

strange thing. just merged your changes back into mine. PS: a small typo in your readme: "necessary"

Hyra commented 13 years ago

Thanks :) Fixed. Shall i close this Pull Request for now so we can work on another one when needed?

Hyra commented 13 years ago

Awesome work, sir.