pear install phpunit/PHP_Selenium not finding selenium package - selenium

I am new for TDD and following "Agile Web application Development with yii" book. I have successfully installed phpunit and trying to install selenium extension as book recommends. But when i try to install phpunit_selenim, it gives me following error:
No releases available for package "pear.phpunit.de/PHP_Selenium" install failed
I have tried to do the installation process here, but it did not help, i got the same result. is there anything i missed up or there is another way to install it?
P.S. I am using ubuntu with lamp server to develop yii application.

Try next sequence of commands:
pear clear-cache
pear config-set auto_discover 1
pear install PHPUnit/PHPUnit_Selenium
(Also looks like it was attempt to install PHP_Selenium instead of PHPUnit_Selenium package according to your error message)

Can't add comment, so before Sergey's answer do:
sudo pear install phpunit
sudo pear channel-discover pear.phpunit.de
After, Sergey's:
pear clear-cache
pear config-set auto_discover 1
pear install PHPUnit/PHPUnit_Selenium
This work for me at least.

Related

Laravel valet linked php error

I got an error.
$ valet install
[DomainException]
Unable to determine linked PHP.
install
'which' command returns:
$ which php
/usr/local/Cellar/php70/7.0.6/bin/php
I used Homebrew to instal php7.1 , So I ran this command in terminal
ln -s /usr/local/opt/php71/bin/php /usr/local/bin/php
and everything is done.
if your PHP version 7.x and valet > 2.0.8 update valet
valet stop
valet uninstall
brew install php
composer global require laravel/valet
then valet install
Homebrew creates (or attempts to create) symlinks in /usr/local/bin.
Start by running the following to attempt to create a link.
brew link php70
It'll give you information as to whether or not it was successful. Occasionally permissions are problematic and you can resolve this with
sudo chown -R `whoami`:admin /usr/local/bin
Then try running the brew link command again.
Alternately brew link may give you instructions, or you can use brew doctor to get a report on any problems which exist with your Homebrew installation.
When it's set up properly after running ls -la /usr/local/bin | grep bin/php$ you should see something similar to
lrwxr-xr-x 1 YOURUSER admin 29 10 May 21:40 php -> /usr/local/Cellar/php70/7.0.6/bin/php
I was going to update Laravel Valet from version 1.* to 2 and ran same error like this
Unable to determine linked PHP
The solution was to run
composer global update
before I ran
valet install
This happens when your brew php gets Updated.
If you do brew install php this will work but will install php 7.2 by default.
If you want php#7.1 you have to do brew install php#7.1 this will install php7.1 and now when you restart valet valet restart you might get an error. Unable to determine linked PHP.
To make this work with php7.1 you have make brew link
brew link php71
you may have this error
Warning: php#7.1 is keg-only and must be linked with
to fix this
brew link --force php71
now valet should work on php7.1
I tried all of the suggestions here—and several from elsewhere—before I hit on the solution. This applies to PHP 7.2 (no guarantee for other versions). If you are using the original Larvel Valet, open the file:
~/.composer/vendor/laravel/valet/cli/Valet/Brew.php
...or, if you're using Valet+
~/.composer/vendor/weprovide/valet-plus/cli/Valet/Brew.php
Locate the supportedPhpVersions method. In some versions, it will return an array right in the method:
return ['php72', 'php71', 'php70', 'php56'];
Change this to:
return ['7.2', 'php72', 'php71', 'php70', 'php56'];
In other cases, it'll reference const SUPPORTED_PHP_VERSIONS, and the change will be similar.
Save the file, restart valet, and Bob's your uncle!

What provides libicui18n.so.52.1()(64bit) on Fedora (23)?

I'm trying to install libQt5Core from an rpm and I get:
Error: nothing provides libicui18n.so.52.1()(64bit) needed by libQt5Core5-5.5.1-4.1.x86_64
There is newer version:
dnf whatprovides libicui18n*
Last metadata expiration check performed 0:00:14 ago on Fri Jan 29 13:58:14 2016.
libicu-54.1-5.fc23.x86_64 : International Components for Unicode - libraries
Repo : #System
Where do you install the libQt5Core from? The official repositories should not require packages versions that are not available.
Don't use that RPM to install the QT 5 core libraries. I'm guessing that you have a package for openSUSE (because that's what comes up when I Google for "libQt5Core rpm"). In Fedora, the package you want is qt5-qtbase. Install that with:
sudo dnf install qt5-qtbase
It happens that our version in Fedora 23 is also version 5.5.1, so I think that'll be what you really need here.
If you're doing software development, you might want to pull in the KDE Frameworks 5 development group, which is mostly QT stuff and which will get you set up for building programs against that, which might be what you're trying to do:
sudo dnf groupinstall kf5-software-development

PHPUnit disable info when doing test

recently i started using phpunit. I like it very much and so on... but some-times unnecessary info annoying me
So, my question is how to disable it???
phpunit is stopping support via PEAR channels after december meaning you won't get updates etc to your current installation, you can use a PHAR package or you can use composer to install phpunit
see
http://pear.phpunit.de/
phpunit pear end-of-life announcement
to remove the error reinstall using alternative install methods see for more details
phpunit installation documentation
you can remove pear installation with this command
pear uninstall phpunit/PHPUnit
and you can install using phar with these commands
wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
mv phpunit.phar /usr/local/bin/phpunit
Edit: Note you need additional optional dependencies for yii( which PEAR may have handled) to be able to run test cases and so if you are using composer use
composer global require "phpunit/phpunit>=3.7.*"
composer global require 'phpunit/phpunit-selenium=*'
composer global require 'phpunit/phpunit-story=*'
composer global require 'phpunit/dbunit=*'
composer global require 'phpunit/php-invoker=*'
To remove the PEAR version of PHPUnit:
pear uninstall phpunit/PHPUnit
The instructions for installing the new version of PHPUnit are here:
http://phpunit.de/manual/4.1/en/installation.html

PHPunit test failed with Yii framework

My local system is WAMP (win 8.1) with Yii 1.1.14.
I had installed PHPUnit by pear.(CMD: pear install phpunit/PHPUnit)
But the test failed.
Could someone give me some hint? Many thanks.
Following is the error message.
C:\wamp\www\trackstar\protected\tests>phpunit --version
PHPUnit 4.0.14 by Sebastian Bergmann.
C:\wamp\www\trackstar\protected\tests>phpunit unit/DbTest.php
PHP Warning: require_once(PHPUnit/Extensions/SeleniumTestCase.php): failed to o
pen stream: No such file or directory in C:\wamp\www\yii\framework\test\CWebTest
Case.php on line 12
You have to install some extension, in this case Selenium. I assume you run selenium tests and that is you you have to extend that.
In Linux you would have to install it with
pear install phpunit/PHPUnit_Selenium
Not sure quite what the command is in Windows.

cannot install pear install phpunit/PHPUnit_Selenium

I am trying to install PHPUnit_Selenium using the command
pear install phpunit/PHPUnit_Selenium
The version of pear that i am running is 1.9.4. The above command returned
Attempting to discover channel "phpunit"...
Attempting fallback to https instead of http on channel "phpunit"...
unknown channel "phpunit" in "phpunit/PHPUnit_Selenium"
invalid package name/package file "phpunit/PHPUnit_Selenium"
install failed
Searching google I found this (a few times) as a suggestion. So I tried
pear channel-discover pear.phpunit.de
and
sudo pear channel-discover pear.phpunit.de (incase it made a difference)
previous command returned
Discovering channel pear.phpunit.de over http:// failed with message: channel-add: Cannot open "http://pear.phpunit.de/channel.xml" (File http://pear.phpunit.de:80/channel.xml not valid (received: HTTP/1.1 403 Forbidden ( Forefront TMG denied the specified Uniform Resource Locator (URL). )
))
Trying to discover channel pear.phpunit.de over https:// instead
Discovery of channel "pear.phpunit.de" failed (channel-add: Cannot open "https://pear.phpunit.de/channel.xml" (Connection to `pear.phpunit.de:443' failed: Operation timed out))
What do I need to do to install PHPUnit_Selenium?
The PEAR channel for phpunit has been discontinued as of the end of April 2014, to install PHPUnit and PHPUnit_Selenium install via composer.
Configure your composer.json to the specific package version (See PHPUnit_Selenium)
In your composer.json file, write:
{
"require": {
"phpunit/phpunit": "*",
"phpunit/phpunit-selenium": ">=1.3.3"
}
}
Try the following command:
$ composer install
Use "pear.phpunit.de" instead of "phpunit"
sudo pear install pear.phpunit.de/PHPUnit_Selenium
Phpunit require curl to be installed,if you didn't install it try this:
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
sudo service apache2 restart
Maybe you need to specify a proxy for pear to route it's traffic through. Try something like:
$ sudo pear config-set http_proxy http://foo.bar/
$ sudo pear channel-discover pear.phpunit.de
$ sudo pear install phpunit/PHP_Selenium
Installing phpunit-selenium package in Ubuntu Trusty is as easy as running:
apt-get install phpunit-selenium