sábado, 2 de abril de 2011

Instalando PHPUnit no windows

Para instalar PHPUnit no windows, devemos instalar o PEAR executando o script go-pear.bat que encontra-se no diretório de instalação do PHP.

C:\php\>go-pear
Are you installing a system-wide PEAR or a local copy?
(system|local) [system] : (ENTER)
Below is a suggested file layout for your new PEAR installation. To
change individual locations, type the number in front of the
directory. Type 'all' to change all of them or simply press Enter to
accept these locations.
1. Installation base ($prefix) : C:\php
2. Temporary directory for processing : C:\php\tmp
3. Temporary directory for downloads : C:\php\tmp
4. Binaries directory : C:\php
5. PHP code directory ($php_dir) : C:\php\pear
6. Documentation directory : C:\php\docs
7. Data directory : C:\php\data
8. User-modifiable configuration files directory : C:\php\cfg
9. Public Web Files directory : C:\php\www
10. Tests directory : C:\php\tests
11. Name of configuration file : C:\Windows\pear.ini
12. Path to CLI php.exe : C:\php

1-12, 'all' or Enter to continue: (ARRUME OS PATHS)
Beginning install...
Configuration written to C:\Windows\pear.ini...
Initialized registry...
Preparing to install...

installing phar://go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.3.3.tar...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.2.3.tar...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.9.0.tar...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.2.tar...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.2.1.tar...

install ok: channel://pear.php.net/Archive_Tar-1.3.3
install ok: channel://pear.php.net/Console_Getopt-1.2.3
install ok: channel://pear.php.net/Structures_Graph-1.0.2
install ok: channel://pear.php.net/XML_Util-1.2.1
install ok: channel://pear.php.net/PEAR-1.9.0

PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"

The 'pear' command is now at your service at c:\php\pear.bat

* WINDOWS ENVIRONMENT VARIABLES *
For convenience, a REG file is available under c:\php\PEAR_ENV.reg

This file creates ENV variables for the current user.
Double-click this file to add it to the current user registry.

Press any key to continue . . .


Adicione os repositórios do PHPUnit e atualize-os:
C:\php\>pear channel-discover pear.phpunit.de
Adding Channel "pear.phpunit.de" succeeded
Discovery of channel "pear.phpunit.de" succeeded

C:\php\>pear channel-discover pear.symfony-project.com
Adding Channel "pear.symfony-project.com" succeeded
Discovery of channel "pear.symfony-project.com" succeeded

C:\php\>pear update-channels
Updating channel "doc.php.net"
Channel "doc.php.net" is up to date
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
Updating channel "pear.phpunit.de"
Channel "pear.phpunit.de" is up to date
Updating channel "pear.symfony-project.com"
Channel "pear.symfony-project.com" is up to date
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date

C:\php>pear upgrade-all
Will upgrade channel://pear.php.net/archive_tar
Will upgrade channel://pear.php.net/pear
Will upgrade channel://pear.php.net/structures_graph
downloading Archive_Tar-1.3.7.tgz ...
Starting to download Archive_Tar-1.3.7.tgz (17,610 bytes)
......done: 17,610 bytes
downloading PEAR-1.9.1.tgz ...
Starting to download PEAR-1.9.1.tgz (293,587 bytes)
...done: 293,587 bytes
downloading Structures_Graph-1.0.3.tgz ...
Starting to download Structures_Graph-1.0.3.tgz (30,191 bytes)
...done: 30,191 bytes
upgrade-all ok: channel://pear.php.net/Archive_Tar-1.3.7
upgrade-all ok: channel://pear.php.net/Structures_Graph-1.0.3
upgrade-all ok: channel://pear.php.net/PEAR-1.9.1

PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"


Instalando PHPUnit 3.4.14

C:\php\>pear install phpunit/PHPUnit
Did not download optional dependencies: pear/Image_GraphViz, pear/Log, symfony/YAML,
use --alldeps to download automatically

phpunit/PHPUnit can optionally use package "pear/Image_GraphViz" (version >= 1.2.1)
phpunit/PHPUnit can optionally use package "pear/Log"
phpunit/PHPUnit can optionally use package "symfony/YAML" (version >= 1.0.2)
phpunit/PHPUnit can optionally use PHP extension "soap"
phpunit/PHPUnit can optionally use PHP extension "xdebug" (version >= 2.0.5)

downloading PHPUnit-3.4.14.tgz ...
Starting to download PHPUnit-3.4.14.tgz (254,983 bytes)
.....................................................done: 254,983 bytes
install ok: channel://pear.phpunit.de/PHPUnit-3.4.14


É isso! Espero que gostem.

Nenhum comentário: