-
Notifications
You must be signed in to change notification settings - Fork 273
Testing on Windows Guide
-
Install PHP via the Web Platform Installer. choose PHP from SDK list, then click the download arrow for Windows, it should download PHP 5.3.24 and Azure Emulators and its other dependent products, it will install the PHP runtime to
C:\Program Files (x86)\IIS Express\PHP\v5.3
-
Add the PHP install folder to the path at Environment Variables.
-
Setup error reporting to easily debug test failures. Edit the
php.ini
file in the install folder, changing the values of the following properties:
error_reporting = E_ALL | E_STRICT
display_errors = on
display_startup_errors = on
-
Install, upgrade and configure PEAR.
-
Request go-pear.phar in your browser and save the output to a local file
go-pear.phar
at php runtime path -
From an administrator command prompt, run
php go-pear.phar
-
Select system for the system|local
-
Type enter for all the questions.
-
When go-pear.phar is completed, a new file
PEAR_ENV.reg
will be created. Run the file to register environment variables for the administrator. -
Run the
PEAR_ENV.reg
from a normal command prompt so the normal user can access PEAR. -
Reboot so the environment variables will be applied.
-
Install required libraries from an administrator command prompt:
pear clear-cache
pear config-set preferred_state beta
pear config-set auto_discover 1
pear install http_request2
pear install mail_mime
pear install Mail_mimeDecode
pear install pear.phpunit.de/PHPUnit
pear install pear.phpqatools.org/phpqatools pear.netpirates.net/phpDox
pear channel-discover pear.bovigo.org
pear install bovigo/vfsStream-beta
pear channel-discover pear.phpdoc.org
pear install phpdoc/phpDocumentor-alpha
-
Install Git for Windows from here.
-
Create test folder and Download PHP SDK source code via Git
From Git Bash, type the following command
git clone https://github.com/WindowsAzure/azure-sdk-for-php.git
then type command for the branch you like to run (eg. dev branch here, if run on master branch, no need to run "git checkout dev" cmd below)
cd azure-sdk-for-php git checkout dev
-
Install xDebug. Follow the instructions from the installation wizard.
The unit test requires authenticated access of Windows Azure, a few environment variables need to be configured on the test box to enable unit test to get authorized properly. The envrionment variables should be set up like this:
REM Storage
set AZURE_STORAGE_ACCOUNT=jcooketest
set AZURE_STORAGE_KEY=cLA1oIj4L4nElnK6IdPqHppsglpBiVX...
REM Service Bus
set SERVICE_BUS_NAMESPACE=jcooketest
set WRAP_AUTHENTICATION_NAME=owner
set WRAP_PASSWORD=CgXCeMjmTpx74...
REM Service Management
set SERVICE_MANAGEMENT_CERTIFICATE_PATH=C:/Users/jcooke/Desktop/PHPCert1.pem
set SERVICE_MANAGEMENT_COMPLEX_PACKAGE_CONFIGURATION=http://jcooketest2.blob.core.windows.net/deployment/ServiceConfiguration.Cloud.cscfg
set SERVICE_MANAGEMENT_COMPLEX_PACKAGE_URL=http://jcooketest2.blob.core.windows.net/deployment/WindowsAzureProject2.cspkg
set SERVICE_MANAGEMENT_SIMPLE_PACKAGE_CONFIGURATION=http://jcooketest2.blob.core.windows.net/deployment/SimpleServiceConfiguration.Cloud.cscfg
set SERVICE_MANAGEMENT_SIMPLE_PACKAGE_URL=http://jcooketest2.blob.core.windows.net/deployment/SimplePackage.cspkg
set SERVICE_MANAGEMENT_SUBSCRIPTION_ID=c4a9870f-...
For the tests to work properly, each service that is tested should be empty. For example, the blob service should have no blobs or containers, there should be no queues, etc.
From a command prompt in the azure-sdk-for-php
folder, run:
REM Run the main unit tests
phpunit -c phpunit.xml.dist
REM Run the extended integration tests
phpunit -c phpunit.functional.xml.dist