Does a global phpunit check for local version? - phpunit

I have installed phpunit globally (v7.1.4). My project uses phpunit ^6 as defined in composer.json.
If I run $ phpunit --version within the project dir I see:
$ phpunit --version
PHPUnit 7.1.4 by Sebastian Bergmann and contributors.
But if I run my tests another version is used:
$ phpunit
PHPUnit 6.5.7 by Sebastian Bergmann and contributors.
............. 13 / 13 (100%)
Time: 839 ms, Memory: 10.00MB
OK (13 tests, 16 assertions)
My question is: Does phpunit check for a locally installed version and uses this for the project or is my system acting weired?

No, PHPUnit does nothing of the sort.
You have a project-local version of PHPUnit installed via Composer but do not invoke it via ./vendor/bin/phpunit. Thus the globally installed PHPUnit is used.

Related

SBT fails to launch on ARM64 Apple silicon with error Could not find required component 'xsbti'

When I launch SBT 1.5 using the command which in turn launches version 0.13 for the project
❯ sbt -v
[sbt_options] declare -a sbt_options='()'
[process_args] java_version = '8'
# Executing command line:
java
-Dfile.encoding=UTF-8
-Xms1024m
-Xmx1024m
-Xss4M
-XX:ReservedCodeCacheSize=128m
-jar
/opt/homebrew/Cellar/sbt/1.5.0/libexec/bin/sbt-launch.jar
[info] Loading global plugins from /Users/viswanath/.sbt/0.13/plugins
[info] Updating {file:/Users/viswanath/.sbt/0.13/plugins/}global-plugins...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
I get the following error
[error] (compile:compileIncremental) sbt.InvalidComponent: Could not find required component 'xsbti'
on my MacBookPro with M1 processor (a.k.a Apple silicon) on ARM64 architecture. Any clue on how to fix this problem?
Note: Bundled SBT runs fine on IntelliJ
Try installing with SDKMAN
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install java
sdk install sbt
sbt compile
Bumped up the project's SBT version to 1.5.0 and the problem disappeared. See this githib issue for more information.
Alternatively, check this workaround on SBT 1.5.0 for launching SBT in interactive mode.
sbt -Dsbt.boot.directory=/tmp/boot1 -Dsbt.launcher.coursier=false

Error: The deployment target requir Qt libs, but init qmake is failed. (CQtDeployer)

i am try to use CQtDeployer.
I am using ubuntu 18.04 and QT 5.9.5.
I want to run this on terminal:
cqtdeployer -bin MY_APP_NAME_IN_RELEASE_FOLDER -qmake /usr/lib/qt5/bin/qmake
Note:
/usr/lib/qt5/bin/qmake -> FROM QT CREATOR -> options -> qt versions -> autodetected qt 5.9.5 -> qmake locations
Result:
Info: Deploy ...
Info: flag targetDir not used. use default target dir :/root/Masaüstü/RELEASE/DistributionKit
Error: The deployment target requir Qt libs, but init qmake is failed.
Error: deploy is failed!
Note2:
root#ubuntu-pc:~/DEPLOY_TEST_1# qmake --version
QMake version 3.1
Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu
What's the problem?
And the solution:
Blockquote
Solution 1
As a workaround, uninstall the snap version of cqtdeployer and install cqtdeployer from the installer.
Solution 2
Install Qt from an official source in user space.
If you are unable to use the GUI, use the console utility to install Qt
Blockquote
Solution from : https://github.com/QuasarApp/CQtDeployer/issues/373#issuecomment-637762214

Homebrew: How do I install PHPUnit 6.5?

I'm trying to install php unit version 6.5.
I already have 7.0.1 install and I have attempted to install phpunit versions 6.5 with:
brew install phpunit#6.5
Brew tells me that the older version is installed but phpunit --version is 7.0.1.
Trying brew switch phpunit 6.5, I get the message:
Error: phpunit does not have a version "6.5" in the Cellar.
Versions available: 7.0.1
What steps do I need to take to switch versions to 6.5?
I've installed manually:
$ wget https://phar.phpunit.de/phpunit-6.5.phar
$ chmod +x phpunit-6.5.phar
$ sudo mv phpunit-6.5.phar /usr/local/bin/phpunit
$ phpunit --version
If I am not mistaking, this is because the current version is 6.5.6 and not just 6.5
If this fails, maybe try doing a manual install from their archived package, instructions can be found here
If you still don't succeed, you could also try with composer to manage your project packages

travis not installing composer dependencies

All of my Travis builds failed because my composer dependencies are not installed (the before_script step seems skipped).
Here is my .travis.yml:
language: php
sudo: required
php:
- 5.4
before_script:
- composer install --dev
script:
- phpunit -c app
I'm sure this is something I missed but I'm not sure what. This is my last build log.
I took a look at your repository and the issue is the encoding of your Travis configuration file. Changing the encoding (removing the BOM) makes it work: https://travis-ci.org/huitiemesens/functionnal-test-generator/builds/99764001
Change the configuration to install your dependencies in the install step:
# ...
install:
- composer install
# ...

unable to install PHPunit on my local machine

I am Trying to install phpunit on my local mac machine, but I got the followings error when I ran the command below:
sudo pear install pear.phpunit.de/PHPUnit
parse error in /private/etc/php.ini on line 786
Check /private/etc/php.ini on line 786. There would be some parsing error.
After solving that,you can refer following blog for PHPUnit installation.
Installing PHPUnit On Windows

Resources