codeception icon indicating copy to clipboard operation
codeception copied to clipboard

Installation of vendor/bin/codecept goes wrong

Open JustDoItSascha opened this issue 9 years ago • 6 comments

I've tried to install cakephp/codeception to a new project, but when I run codecept bootstrap it does not generate the folders and files like it should. They are in the "normal" codeception style and not your CakePHP style, e. g. camelCase....

So I assume, theres something wrong. When I look into codecept I see:

require_once dirname(FILE).'/autoload.php';

use Symfony\Component\Console\Application;

$app = new Application('Codeception', Codeception\Codecept::VERSION); $app->add(new Codeception\Command\Build('build')); $app->add(new Codeception\Command\Run('run')); $app->add(new Codeception\Command\Console('console')); $app->add(new Codeception\Command\Bootstrap('bootstrap')); $app->add(new Codeception\Command\GenerateCept('generate:cept')); $app->add(new Codeception\Command\GenerateCest('generate:cest')); $app->add(new Codeception\Command\GenerateTest('generate:test')); $app->add(new Codeception\Command\GeneratePhpUnit('generate:phpunit')); $app->add(new Codeception\Command\GenerateSuite('generate:suite')); $app->add(new Codeception\Command\GenerateHelper('generate:helper')); $app->add(new Codeception\Command\GenerateScenarios('generate:scenarios')); $app->add(new Codeception\Command\Clean('clean')); $app->add(new Codeception\Command\GenerateGroup('generate:group')); $app->add(new Codeception\Command\GeneratePageObject('generate:pageobject')); $app->add(new Codeception\Command\GenerateStepObject('generate:stepobject')); $app->run();

JustDoItSascha avatar Jul 17 '15 07:07 JustDoItSascha

It seems, that the \Cake\Codeception\Console\Installer::customizeCodeceptionBinary() changes just the codecept file in vendor/codeception but it should change the codecept file in vendor/bin, should'nt it?

JustDoItSascha avatar Jul 17 '15 08:07 JustDoItSascha

Seems like it should! Are you able to provide a pull request to fix this?

lorenzo avatar Jul 17 '15 08:07 lorenzo

Yes, I can do that.

Another question: Do the normal cakephp fixtures work? Because when I try to use them like always, they are not loaded... Any ideas?

JustDoItSascha avatar Jul 17 '15 08:07 JustDoItSascha

@JustDoItSascha - I can't remember if I was able (or even tried) to override the one in vendor/bin - but if you can, try it (maybe i just did not want to override their original one, can't remember really).

How are you using the fixtures?

jadb avatar Jul 17 '15 12:07 jadb

The files in vendor/bin are just symlinks, at least for me on OS X, so things work fine here:

$ ll vendor/bin/
vendor/bin/codecept -> ../codeception/codeception/codecept
phpunit -> ../phpunit/phpunit/phpunit

Make sure your app's Installer has this line, or check 2f76c02ee879b35697d8e40144e2daadf0b1a97c.. maybe these will give you some leads.

Can't comment on fixtures yet, but let us know if you had any luck.

deizel avatar Jul 24 '15 07:07 deizel

Hi, sorry that I couldn't answer at all, had a very busy time. But now I can focus on this project a bit again. So I reinstalled the package and see a very odd behavior:

You are right, the files in vendor/bin are symlinks; however when I open the symlink with nano I get the old version though the original file has been changed by the script.

I don't know why. I'm using Yosemite and never saw such a behavior nor did know it is possible at all...

Now is the question: Is it a problem on my side or in mac osx in general?

JustDoItSascha avatar Sep 24 '15 09:09 JustDoItSascha