Skip to content

Commit

Permalink
preparing unit tests for leads
Browse files Browse the repository at this point in the history
  • Loading branch information
atwellpub committed Sep 30, 2014
1 parent 1ddee20 commit de9aa8e
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ matrix:
before_script:
- export PLUGIN_SLUG=$(basename $(pwd))
- git clone --depth=50 --branch="$WP_VERSION" git://develop.git.wordpress.org/ /tmp/wordpress
- git clone --branch="master" https://github.com/inboundnow/cta.git /tmp/wordpress/wp-content/plugins/cta
- git clone --branch="master" https://github.com/inboundnow/landing-pages.git /tmp/wordpress/wp-content/plugins/leads
- cd ..
- mv "$PLUGIN_SLUG" "/tmp/wordpress/src/wp-content/plugins/$PLUGIN_SLUG"
- cd /tmp/wordpress
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<testsuites>
<!-- Default test suite to run all tests -->
<testsuite>
<directory prefix="test_" suffix=".php">tests/travis-ci</directory>
<directory prefix="test." suffix=".php">tests/travis-ci/</directory>
</testsuite>
</testsuites>
</phpunit>
6 changes: 5 additions & 1 deletion tests/travis-ci/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

// Activates this plugin in WordPress so it can be tested.
$GLOBALS['wp_tests_options'] = array(
'active_plugins' => array( 'cta/wordpress-cta.php' ),
'active_plugins' => array(
'leads/wordpress-leads.php' ,
'landing-pages/landing-pages.php' ,
'cta/wordpress-cta.php'
),
);

// If the develop repo location is defined (as WP_DEVELOP_DIR), use that
Expand Down
40 changes: 40 additions & 0 deletions tests/travis-ci/test.activations.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

/**
* Tests to test that that testing framework is testing tests. Meta, huh?
*
* @package wordpress-plugins-tests
*/
class WP_Test_WordPress_Plugin_Tests extends WP_UnitTestCase {

/**
* Run a simple test to ensure that the tests are running
*/
function test_tests() {
$this->assertTrue( true );
}

/**
* Ensure landing pages is active
*/
function test_lading_pages_activated() {
$this->assertTrue( is_plugin_active( 'landing-pages/landing-pages.php' ) );
}

/**
* Ensure that the Leads has been installed and activated.
*/
function test_leads_activated() {
$this->assertTrue( is_plugin_active( 'leads/wordpress-leads.php' ) );
}

/**
* Ensure that the Calls to Action has been installed and activated.
*/
function test_cta_activated() {
$this->assertTrue( is_plugin_active( 'cta/wordpress-cta.php' ) );
}

}

?>

0 comments on commit de9aa8e

Please sign in to comment.