Codeception `build -c` option removed in 2.2? - php

I get an alert. Tests are failing. And not just on my last commit... But on every branch. So something must be wrong with the automated testing. Right?
And here's the message:
Failing command: php /var/www/codecept.phar build -c /var/www/protected/tests/
Exit code: 1
Output:
[Symfony\Component\Console\Exception\RuntimeException]
The "-c" option does not exist.
OK. But it works locally... Hmm... Let's check if I'm running the same version.
I'm not:
$ codecept -v
Codeception version 2.1.9
$ wget http://codeception.com/codecept.phar
$ php ./codecept.phar -v
Codeception version 2.2.1
So I'm running 2.1.9. And my tests pass. Test continuous environment is getting the latest version 2.2.1. And it fails.
Let's check out the help for 2.1.9:
$ codecept help build
Usage:
build [options]
Options:
-c, --config[=CONFIG] Use custom path for config
-h, --help Display this help message
-q, --quiet Do not output any message
<snip>
There's the option. -c, --config.
And now let's look at 2.2.1:
$ php ./codecept.phar help build
Usage:
build
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
<snip>
Hey! There is no longer a -c option.
What can I do to point codecept at the config directory?

https://github.com/Codeception/Codeception/issues/3173
Something is wrong with phar files of 2.2.1 version, I can only recommend to use Codeception installed with composer until that issue is fixed.

Related

Phpdoc is not defined, but -V is work

I installed the phpdocumentator via composer.
But I have an error:
Command php composer.phar phpdoc -V is work
And yet I did not understand the message: No composer.json in current directory... But it is now in this directory. -ls confirms this fact
Shouldn't you be executing phpdoc this way:
./vendor/bin/phpdoc -d env/production -t env/autodoc ?
Your command appears to only be calling the -V version option of composer.phar, and doing nothing whatsoever with regard to phpdoc.

PhpStorm doesn't read PHP configuration from Docker container

What I want
Run PHPUnit by terminal and configuration in PhpStorm
What I Have
Previous problem
Resolved in HERE - about not finding files
File that running
#!/usr/bin/env bash
# echo "Current working directory: '"$(pwd)"'"
cd $(pwd) && docker run --rm -t -v $(pwd):/var/www -e SYMFONY_ENV=dev ezsystems/php:7.1-v1-dev php $#
Summary
When I run this by terminal:
docker-phpez vendor/bin/phpunit --coverage-text
Everything working correctly.
When I try to run this with configuration of PhpStorm, I get warning that: PHP is not installed.
But running this as remote PHP interpreter, gives me:
docker://ezsystems/php:7.1-v1/php /opt/.phpstorm_helpers/phpunit.php --configuration /var/www/phpunit.xml.dist
Testing started at 17:06 ...
The value $_SERVER['IDE_PHPUNIT_PHPUNIT_PHAR'] is specified, but file doesn't exist '/var/www/vendor/bin/phpunit'
Process finished with exit code 1
Looking like mounting doesn't work.
Question:
do you know why? How to fix that?
In previous version of PhpStorm I didn't had any problem with that.
Right now, I have 2016.3.2.
Because after update you have to update tags for phpstorm_helpers docker image. There i put more how it should be fixed: https://youtrack.jetbrains.com/issue/IDEA-189164
After updating PHPStorm to 2017.1.4, what I did:
switched to docker configuration
phpunit loaded from composer's autoload.php
Started to working. Still don't know why docker-phpez not working by PHPStorm, but I will stop for now.

Laravel/Lumen - missing commands in Artisan console

I have a problem with runing Laravel's Artisan. There are most of the commands missing. Everything worked fine till the last composer/code update.
For an example if I write php artisan migrate, I get following error: Command "migrate" is not defined.
Below is an example of output that I get by typing php artisan.
Laravel Framework version Lumen (5.1.6) (Laravel Components 5.1.*)
Usage:
command [options] [arguments]
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--env[=ENV] The environment the command should run under.
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Available commands:
help Displays help for a command
list Lists commands
serve Serve the application on the PHP development server
schedule
schedule:run Run the scheduled commands
Does anyone have any ideas how to fix this?
It seems there was a problem with composer. Somehow composer.lock got into git ignore list and libraries used on production were different than the ones used in development.
The syntax has changed to php artisan make:migration.
You can see a full list of commands by running php artisan list

Why PHPStorm says "dyld: Library not loaded: /usr/local/lib/libpng15.15.dylib" when I run tests?

Each time I try to run tests with PHPStorm I get this error:
/usr/bin/php /private/var/folders/jl/34t9y2h94jsgchv4wfcxl6g80000gn/T/ide-phpunit.php -c app --configuration /Users/simonegentili/Sviluppo/web/wishventures/SendA/app/phpunit.xml.dist WishVentures\GeeftyApiBundle\Test\Controller\ApiControllerTest /Users/simonegentili/Sviluppo/web/wishventures/SendA/src/WishVentures/GeeftyApiBundle/Tests/Controller/ApiControllerTest.php
Testing started at 18:46 ...
dyld: Library not loaded: /usr/local/lib/libpng15.15.dylib
Referenced from: /usr/bin/php
Reason: image not found
Process finished with exit code 133
I've found this question but
$ brew update && brew upgrade
$ brew reinstall php55
did not solve my troubles. Well, ... PHPStorm is looking for libpng15.15.dylib, but I've libpng16.16.dylib. I think is a broken link issue. How to solve it?
The reason was that I had two version of php installed on my computer. One reached via /usr/bin/php and another from /usr/local/bin/php. The first one was a link to php version 5.5.8 and the second one was 5.5.14
I sow that dyld (dynamic linker of Operating System) was looking for /usr/local/lib/libpng15.15.dylib (maybe called by php 5.5.8) but inside my /usr/local/lib/ there was not. In that folder, I got libpng16.16.dylib (I think ... because I've installed php55 via brew and this version oh php needs new version of libpng).
I undestood that my /usr/bin/php was a pointer to php 5.5.8. Instead, ... /usr/local/bin/php was 5.5.14. PHPStorm worked with /usr/bin/php that is default configuration. When I run php via console, I run /urs/local/bin/php.

How to create a command for a Laravel 4 package?

The docs says that we can create a command for a package in Laravel 4.1 typing:
php artisan command:make AssignUsers --bench="vendor/package"
But it seems to not be working, I got the following error message:
[RuntimeException]
The "--bench" option does not exist.
Is there a way to create a command for a Laravel 4 package?
I used the standard artisan command to create a command into my package:
php artisan command:make CreateUsers \
--path="workbench/vendor/package/src/vendor/package"
After that, to make it available in the consumer application I had to add the following into my package's ServiceProvider (in the boot method):
$this->app->bind('vendor::command.user.create', function($app) {
return new UserCreateCommand();
});
$this->commands(array(
'vendor::command.user.create'
));
After that, everything will work fine.
when you run you will sse the list of arguments for make
php artisan command:make --help
you should see something like
Usage:
command:make [--command[="..."]] [--path[="..."]] [--namespace[="..."]] name
Arguments:
name The name of the command.
Options:
--command The terminal command that should be assigned.
--path The path where the command should be stored.
--namespace The command namespace.
--help (-h) Display this help message.
--quiet (-q) Do not output any message.
--verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
--version (-V) Display this application version.
--ansi Force ANSI output.
--no-ansi Disable ANSI output.
--no-interaction (-n) Do not ask any interactive question.
--env The environment the command should run under.
as you can see from that output there is no argument bench
the proper way to do it is
php artisan command:make AssignUsers
then go to /app/start/artisan.php and add the following line
Artisan::add(new AssignUsers);
then edit the generated file in /app/commands/AssignUsers.php
change the value of $name to AssignUsers
and you are done.

Categories