Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpunit.xml support with bootstrap-tests.inc.php configuration and ignores #2

Merged
merged 1 commit into from
Apr 21, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
app/code/local/Elite/Vaf/config.ini
app/code/local/Elite/phpunit.xml
17 changes: 11 additions & 6 deletions app/code/local/Elite/Vaf/bootstrap-tests.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@

require_once('bootstrap.php');

# set up paths specific to test environment
define( 'MAGE_PATH', '/home/josh/www/magento' );
define( 'TESTFILES', '/tmp' );
/**
* The paths are controlled by app/code/local/Elite/phpunit.xml.dist
* using the <php><env /></php> section. To make changes, make a copy
* of phpunit.xml.dist to phpunit.xml
*/

define( 'MAGE_PATH', $_ENV['MAGE_PATH']);
define( 'TESTFILES', $_ENV['TESTFILES'] );

# database details for test server
define( 'VAF_DB_USERNAME', 'root' );
define( 'VAF_DB_PASSWORD', '' );
define( 'VAF_DB_NAME', 'magento' );
define( 'VAF_DB_USERNAME', $_ENV['VAF_DB_USERNAME'] );
define( 'VAF_DB_PASSWORD', $_ENV['VAF_DB_PASSWORD'] );
define( 'VAF_DB_NAME', $_ENV['VAF_DB_NAME'] );

# used to make "test only code" run (Google "test code in production")
define( 'ELITE_TESTING', 1 );
Expand Down
33 changes: 33 additions & 0 deletions app/code/local/Elite/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="true"
syntaxCheck="false"
bootstrap="Vaf/bootstrap-tests.php">

<php>
<env name="MAGE_PATH" value="../../../.."/>
<env name="TESTFILES" value="/tmp"/>
<env name="VAF_DB_USERNAME" value="root"/>
<env name="VAF_DB_PASSWORD" value=""/>
<env name="VAF_DB_NAME" value="magento"/>
</php>

<testsuites>
<testsuite name="VF Magento Test Suite">
<directory>Vaf*/</directory>
</testsuite>
<testsuite name="VF Core Test Suite">
<directory>../../../../lib/VF</directory>
</testsuite>
</testsuites>

</phpunit>