Автоматическая установка PHPUnit на windows (через pear)

Для установки необходимо последовательно в режиме командной строки выполнить две команды (предварительно установив PEAR)=

pear channel-discover pear.phpunit.de

и затем =

pear install phpunit/PHPUnit

возможна ошибка, например =

Microsoft Windows XP [Версия 5.1.2600]
(С) Корпорация Майкрософт, 1985-2001.

C:\Documents and Settings\rooter>pear channel-discover pear.phpunit.de
Adding Channel "pear.phpunit.de" succeeded
Discovery of channel "pear.phpunit.de" succeeded

C:\Documents and Settings\rooter>pear install phpunit/PHPUnit
No releases available for package "pear.phpunit.de/PHPUnit"
install failed


Исправить ошибку можно следующим образом

Далее при установке возможно появление сообщения =

C:\Documents and Settings\rooter>pear install phpunit/PHPUnit
Unknown remote channel: pear.symfony-project.com
Did not download optional dependencies: phpunit/PHP_Invoker, use --alldeps to do
wnload automatically

для исправления этой ошибки, а также ДЛЯ УСТАНОВКИ ВСЕХ ДОПОЛНЕНИЙ PEAR =
после того когда вы снова сможете вводить команды в командной строке, выполните команду =

pear install --alldeps --force phpunit/PHPUnit

(если клеить ошибка то очистите кэш пиар такой вот командой = pear clear-cache и повторите попытку)

Теперь проверим работоспособность PHPUnit.

МОЯ КОМАНДНАЯ СТРОКА ПРИ УСТАНОВКЕ (может быть поможет разобраться)=

Microsoft Windows XP [Версия 5.1.2600]
(С) Корпорация Майкрософт, 1985-2001.

C:\Documents and Settings\rooter>pear channel-discover pear.phpunit.de
Adding Channel "pear.phpunit.de" succeeded
Discovery of channel "pear.phpunit.de" succeeded

C:\Documents and Settings\rooter>pear install phpunit/PHPUnit
No releases available for package "pear.phpunit.de/PHPUnit"
install failed

C:\Documents and Settings\rooter>pear remote-list -c phpunit
CHANNEL PHPUNIT AVAILABLE PACKAGES:
===================================
PACKAGE                           VERSION
DbUnit                            1.1.1
File_Iterator                     1.3.0
Object_Freezer                    1.0.0
PHPUnit                           3.6.7
PHPUnit_MockObject                1.1.0
PHPUnit_Selenium                  1.1.3
PHPUnit_Story                     1.0.0
PHPUnit_TestListener_DBUS         1.0.0
PHPUnit_TestListener_XHProf       -n/a-
PHPUnit_TicketListener_Fogbugz    1.0.0
PHPUnit_TicketListener_GitHub     1.0.0
PHPUnit_TicketListener_GoogleCode 1.0.0
PHPUnit_TicketListener_Trac       1.0.0
PHP_CodeBrowser                   1.0.1
PHP_CodeCoverage                  1.1.1
PHP_Invoker                       1.0.1
PHP_Timer                         1.0.2
PHP_TokenStream                   1.1.1
Text_Template                     1.1.1
bytekit                           1.1.2
phpcov                            1.0.0
phpcpd                            1.3.5
phpdcd                            -n/a-
phploc                            1.6.4
ppw                               1.0.4
test_helpers                      1.1.0

C:\Documents and Settings\rooter>pear install phpunit/PHPUnit
No releases available for package "pear.phpunit.de/PHPUnit"
install failed

C:\Documents and Settings\rooter>pear install phpunit/PHPUnit-3.6.7
No releases available for package "pear.phpunit.de/PHPUnit"
install failed

C:\Documents and Settings\rooter>pear update-channels
Updating channel "doc.php.net"
Update of Channel "doc.php.net" succeeded
Updating channel "pear.php.net"
Update of Channel "pear.php.net" succeeded
Updating channel "pear.phpunit.de"
Channel "pear.phpunit.de" is up to date
Updating channel "pecl.php.net"
Update of Channel "pecl.php.net" succeeded

C:\Documents and Settings\rooter>pear install phpunit/PHPUnit
No releases available for package "pear.phpunit.de/PHPUnit"
install failed

C:\Documents and Settings\rooter>pear clear-cache
reading directory C:\DOCUME~1\rooter\LOCALS~1\Temp\pear\cache
78 cache entries cleared

C:\Documents and Settings\rooter>pear channel-discover pear.phpunit.de
Channel "pear.phpunit.de" is already initialized

C:\Documents and Settings\rooter>pear install phpunit/PHPUnit
Unknown remote channel: pear.symfony-project.com
Did not download optional dependencies: phpunit/PHP_Invoker, use --alldeps to do
wnload automatically
phpunit/PHPUnit requires package "channel://pear.symfony-project.com/YAML" (vers
ion >= 1.0.2)
phpunit/PHPUnit can optionally use package "phpunit/PHP_Invoker" (version >= 1.0
.0)
phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2
.0.5)
phpunit/PHPUnit_MockObject can optionally use PHP extension "soap"
downloading File_Iterator-1.3.0.tgz ...
Starting to download File_Iterator-1.3.0.tgz (5,109 bytes)
.....done: 5,109 bytes
downloading Text_Template-1.1.1.tgz ...
Starting to download Text_Template-1.1.1.tgz (3,622 bytes)
...done: 3,622 bytes
downloading PHP_CodeCoverage-1.1.1.tgz ...
Starting to download PHP_CodeCoverage-1.1.1.tgz (132,339 bytes)
...done: 132,339 bytes
downloading PHP_Timer-1.0.2.tgz ...
Starting to download PHP_Timer-1.0.2.tgz (3,686 bytes)
...done: 3,686 bytes
downloading PHPUnit_MockObject-1.1.0.tgz ...
Starting to download PHPUnit_MockObject-1.1.0.tgz (19,688 bytes)
...done: 19,688 bytes
downloading PHP_TokenStream-1.1.1.tgz ...
Starting to download PHP_TokenStream-1.1.1.tgz (9,672 bytes)
...done: 9,672 bytes
install ok: channel://pear.phpunit.de/File_Iterator-1.3.0
install ok: channel://pear.phpunit.de/Text_Template-1.1.1
install ok: channel://pear.phpunit.de/PHP_Timer-1.0.2
install ok: channel://pear.phpunit.de/PHP_TokenStream-1.1.1
install ok: channel://pear.phpunit.de/PHP_CodeCoverage-1.1.1
install ok: channel://pear.phpunit.de/PHPUnit_MockObject-1.1.0

C:\Documents and Settings\rooter>phpunit
"phpunit" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.

C:\Documents and Settings\rooter>pear install --alldeps --force phpunit/phpunit
No releases available for package "pear.phpunit.de/phpunit"
install failed

C:\Documents and Settings\rooter>pear install --alldeps --force phpunit/PHPUnit
No releases available for package "pear.phpunit.de/PHPUnit"
install failed

C:\Documents and Settings\rooter>pear
Commands:
build                  Build an Extension From C Source
bundle                 Unpacks a Pecl Package
channel-add            Add a Channel
channel-alias          Specify an alias to a channel name
channel-delete         Remove a Channel From the List
channel-discover       Initialize a Channel from its server
channel-info           Retrieve Information on a Channel
channel-login          Connects and authenticates to remote channel server
channel-logout         Logs out from the remote channel server
channel-update         Update an Existing Channel
clear-cache            Clear Web Services Cache
config-create          Create a Default configuration file
config-get             Show One Setting
config-help            Show Information About Setting
config-set             Change Setting
config-show            Show All Settings
convert                Convert a package.xml 1.0 to package.xml 2.0 format
cvsdiff                Run a "cvs diff" for all files in a package
cvstag                 Set CVS Release Tag
download               Download Package
download-all           Downloads each available package from the default channel

info                   Display information about a package
install                Install Package
list                   List Installed Packages In The Default Channel
list-all               List All Packages
list-channels          List Available Channels
list-files             List Files In Installed Package
list-upgrades          List Available Upgrades
login                  Connects and authenticates to remote server [Deprecated i
n favor of channel-login]
logout                 Logs out from the remote server [Deprecated in favor of c
hannel-logout]
makerpm                Builds an RPM spec file from a PEAR package
package                Build Package
package-dependencies   Show package dependencies
package-validate       Validate Package Consistency
pickle                 Build PECL Package
remote-info            Information About Remote Packages
remote-list            List Remote Packages
run-scripts            Run Post-Install Scripts bundled with a package
run-tests              Run Regression Tests
search                 Search remote package database
shell-test             Shell Script Test
sign                   Sign a package distribution file
svntag                 Set SVN Release Tag
uninstall              Un-install Package
update-channels        Update the Channel List
upgrade                Upgrade Package
upgrade-all            Upgrade All Packages [Deprecated in favor of calling upgr
ade with no parameters]
Usage: pear [options] command [command-options] <parameters>
Type "pear help options" to list all options.
Type "pear help shortcuts" to list all command shortcuts.
Type "pear help <command>" to get the help for the specified command.

C:\Documents and Settings\rooter>pear clear-cache
reading directory C:\DOCUME~1\rooter\LOCALS~1\Temp\pear\cache
80 cache entries cleared

C:\Documents and Settings\rooter>pear install --alldeps --force phpunit/PHPUnit
Unknown remote channel: pear.symfony-project.com
warning: phpunit/PHPUnit requires package "channel://pear.symfony-project.com/YA
ML" (version >= 1.0.2)
warning: phpunit/PHP_Invoker requires PHP extension "pcntl"
downloading PHPUnit-3.6.7.tgz ...
Starting to download PHPUnit-3.6.7.tgz (118,349 bytes)
..........................done: 118,349 bytes
downloading PHP_Invoker-1.0.1.tgz ...
Starting to download PHP_Invoker-1.0.1.tgz (3,599 bytes)
...done: 3,599 bytes
install ok: channel://pear.phpunit.de/PHPUnit-3.6.7
install ok: channel://pear.phpunit.de/PHP_Invoker-1.0.1

C:\Documents and Settings\rooter>

_____________________________________________
Источники(читать подробнее)=

http://pear.phpunit.de/
____________________________________
Ключевые слова и фразы(для поиска)=
как установить PHPUnit на windows

Key Words for FKN + antitotal forum (CS VSU):

vedro-compota's picture

Microsoft Windows XP [Версия 5.1.2600]
(С) Корпорация Майкрософт, 1985-2001.

C:\Documents and Settings\rooter>pear help
Commands:
build Build an Extension From C Source
bundle Unpacks a Pecl Package
channel-add Add a Channel
channel-alias Specify an alias to a channel name
channel-delete Remove a Channel From the List
channel-discover Initialize a Channel from its server
channel-info Retrieve Information on a Channel
channel-login Connects and authenticates to remote channel server
channel-logout Logs out from the remote channel server
channel-update Update an Existing Channel
clear-cache Clear Web Services Cache
config-create Create a Default configuration file
config-get Show One Setting
config-help Show Information About Setting
config-set Change Setting
config-show Show All Settings
convert Convert a package.xml 1.0 to package.xml 2.0 format
cvsdiff Run a "cvs diff" for all files in a package
cvstag Set CVS Release Tag
download Download Package
download-all Downloads each available package from the default channel

info Display information about a package
install Install Package
list List Installed Packages In The Default Channel
list-all List All Packages
list-channels List Available Channels
list-files List Files In Installed Package
list-upgrades List Available Upgrades
login Connects and authenticates to remote server [Deprecated i
n favor of channel-login]
logout Logs out from the remote server [Deprecated in favor of c
hannel-logout]
makerpm Builds an RPM spec file from a PEAR package
package Build Package
package-dependencies Show package dependencies
package-validate Validate Package Consistency
pickle Build PECL Package
remote-info Information About Remote Packages
remote-list List Remote Packages
run-scripts Run Post-Install Scripts bundled with a package
run-tests Run Regression Tests
search Search remote package database
shell-test Shell Script Test
sign Sign a package distribution file
svntag Set SVN Release Tag
uninstall Un-install Package
update-channels Update the Channel List
upgrade Upgrade Package
upgrade-all Upgrade All Packages [Deprecated in favor of calling upgr
ade with no parameters]
Usage: pear [options] command [command-options]
Type "pear help options" to list all options.
Type "pear help shortcuts" to list all command shortcuts.
Type "pear help " to get the help for the specified command.

C:\Documents and Settings\rooter>pear help force
Command 'force' is not valid, try 'pear help'

C:\Documents and Settings\rooter>

_____________
матфак вгу и остальная классика =)

vedro-compota's picture

кстати , по-идее после вызова команды phpunit в командной строке , вы должны получить что-то вроде того =

Microsoft Windows XP [Версия 5.1.2600]
(С) Корпорация Майкрософт, 1985-2001.

C:\Documents and Settings\rooter>pear help
Commands:
build                  Build an Extension From C Source
bundle                 Unpacks a Pecl Package
channel-add            Add a Channel
channel-alias          Specify an alias to a channel name
channel-delete         Remove a Channel From the List
channel-discover       Initialize a Channel from its server
channel-info           Retrieve Information on a Channel
channel-login          Connects and authenticates to remote channel server
channel-logout         Logs out from the remote channel server
channel-update         Update an Existing Channel
clear-cache            Clear Web Services Cache
config-create          Create a Default configuration file
config-get             Show One Setting
config-help            Show Information About Setting
config-set             Change Setting
config-show            Show All Settings
convert                Convert a package.xml 1.0 to package.xml 2.0 format
cvsdiff                Run a "cvs diff" for all files in a package
cvstag                 Set CVS Release Tag
download               Download Package
download-all           Downloads each available package from the default channel

info                   Display information about a package
install                Install Package
list                   List Installed Packages In The Default Channel
list-all               List All Packages
list-channels          List Available Channels
list-files             List Files In Installed Package
list-upgrades          List Available Upgrades
login                  Connects and authenticates to remote server [Deprecated i
n favor of channel-login]
logout                 Logs out from the remote server [Deprecated in favor of c
hannel-logout]
makerpm                Builds an RPM spec file from a PEAR package
package                Build Package
package-dependencies   Show package dependencies
package-validate       Validate Package Consistency
pickle                 Build PECL Package
remote-info            Information About Remote Packages
remote-list            List Remote Packages
run-scripts            Run Post-Install Scripts bundled with a package
run-tests              Run Regression Tests
search                 Search remote package database
shell-test             Shell Script Test
sign                   Sign a package distribution file
svntag                 Set SVN Release Tag
uninstall              Un-install Package
update-channels        Update the Channel List
upgrade                Upgrade Package
upgrade-all            Upgrade All Packages [Deprecated in favor of calling upgr
ade with no parameters]
Usage: pear [options] command [command-options] <parameters>
Type "pear help options" to list all options.
Type "pear help shortcuts" to list all command shortcuts.
Type "pear help <command>" to get the help for the specified command.

C:\Documents and Settings\rooter>pear help force
Command 'force' is not valid, try 'pear help'

C:\Documents and Settings\rooter>phpunit
PHPUnit 3.6.7 by Sebastian Bergmann.

Usage: phpunit [switches] UnitTest [UnitTest.php]
       phpunit [switches] <directory>

  --log-junit <file>        Log test execution in JUnit XML format to file.
  --log-tap <file>          Log test execution in TAP format to file.
  --log-json <file>         Log test execution in JSON format.

  --coverage-clover <file>  Generate code coverage report in Clover XML format.
  --coverage-html <dir>     Generate code coverage report in HTML format.
  --coverage-php <file>     Serialize PHP_CodeCoverage object to file.
  --coverage-text=<file>    Generate code coverage report in text format.
                            Default to writing to the standard output.

  --testdox-html <file>     Write agile documentation in HTML format to file.
  --testdox-text <file>     Write agile documentation in Text format to file.

  --filter <pattern>        Filter which tests to run.
  --group ...               Only runs tests from the specified group(s).
  --exclude-group ...       Exclude tests from the specified group(s).
  --list-groups             List available test groups.

  --loader <loader>         TestSuiteLoader implementation to use.
  --printer <printer>       TestSuiteListener implementation to use.
  --repeat <times>          Runs the test(s) repeatedly.

  --tap                     Report test execution progress in TAP format.
  --testdox                 Report test execution progress in TestDox format.

  --colors                  Use colors in output.
  --stderr                  Write to STDERR instead of STDOUT.
  --stop-on-error           Stop execution upon first error.
  --stop-on-failure         Stop execution upon first error or failure.
  --stop-on-skipped         Stop execution upon first skipped test.
  --stop-on-incomplete      Stop execution upon first incomplete test.
  --strict                  Run tests in strict mode.
  -v|--verbose              Output more verbose information.
  --debug                   Display debbuging information during test execution.


  --skeleton-class          Generate Unit class for UnitTest in UnitTest.php.
  --skeleton-test           Generate UnitTest class for Unit in Unit.php.

  --process-isolation       Run each test in a separate PHP process.
  --no-globals-backup       Do not backup and restore $GLOBALS for each test.
  --static-backup           Backup and restore static attributes for each test.

  --bootstrap <file>        A "bootstrap" PHP file that is run before the tests.

  -c|--configuration <file> Read configuration from XML file.
  --no-configuration        Ignore default configuration file (phpunit.xml).
  --include-path <path(s)>  Prepend PHP's include_path with given path(s).
  -d key[=value]            Sets a php.ini value.

  -h|--help                 Prints this usage information.
  --version                 Prints the version and exits.

  --debug                   Output debugging information.

C:\Documents and Settings\rooter>

_____________
матфак вгу и остальная классика =)