Skip to content

Commit 9bb49a1

Browse files
committed
Initial commit
0 parents  commit 9bb49a1

File tree

7 files changed

+126
-0
lines changed

7 files changed

+126
-0
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "wpdevel"]
2+
path = wpdevel
3+
url = git://develop.git.wordpress.org/

chassis.pp

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class {"tester": }
2+
class {"tester::config": }

modules/tester/manifests/config.pp

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class tester::config {
2+
file { "/vagrant/extensions/tester/wpdevel/wp-tests-config.php":
3+
content => template("tester/wp-tests-config.php.erb"),
4+
}
5+
6+
file { "/etc/profile.d/tester-env.sh":
7+
content => template("tester/tester-env.sh.erb"),
8+
}
9+
}

modules/tester/manifests/init.pp

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
class tester (
2+
$install_path = "/usr/local/src/phpunit",
3+
) {
4+
# Create the install path
5+
file { $install_path:
6+
ensure => directory,
7+
}
8+
9+
# Download phpunit
10+
exec { "phpunit download":
11+
command => "/usr/bin/curl -o $install_path/phpunit.phar -L https://phar.phpunit.de/phpunit.phar",
12+
require => [ Package[ 'curl' ], File[ $install_path ] ],
13+
creates => "$install_path/phpunit.phar",
14+
}
15+
16+
# Ensure we can run phpunit
17+
file { "$install_path/phpunit.phar":
18+
ensure => "present",
19+
mode => "a+x",
20+
require => Exec[ 'phpunit download' ]
21+
}
22+
23+
# Symlink it across
24+
file { '/usr/bin/phpunit':
25+
ensure => link,
26+
target => "$install_path/phpunit.phar",
27+
require => File[ "$install_path/phpunit.phar" ],
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export WP_DEVELOP_DIR=/vagrant/extensions/tester/wpdevel
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?php
2+
// ===================================================
3+
// Load database info and local development parameters
4+
// ===================================================
5+
$chassisdir = '/vagrant';
6+
if ( file_exists( $chassisdir . '/local-config-db.php' ) ) {
7+
define( 'WP_LOCAL_DEV', true );
8+
include( $chassisdir . '/local-config-db.php' );
9+
}
10+
11+
if ( file_exists( $chassisdir . '/local-config.php' ) ) {
12+
defined('WP_LOCAL_DEV') or define( 'WP_LOCAL_DEV', true );
13+
include( $chassisdir . '/local-config.php' );
14+
}
15+
16+
// =======================
17+
// Load Chassis extensions
18+
// =======================
19+
if ( file_exists( $chassisdir . '/local-config-extensions.php' ) ) {
20+
include( $chassisdir . '/local-config-extensions.php' );
21+
}
22+
23+
// ======================================
24+
// Fake HTTP Host (for CLI compatibility)
25+
// ======================================
26+
if ( empty( $_SERVER['HTTP_HOST'] ) ) {
27+
if ( defined( 'DOMAIN_CURRENT_SITE' ) ) {
28+
$_SERVER['HTTP_HOST'] = DOMAIN_CURRENT_SITE;
29+
}
30+
else {
31+
$_SERVER['HTTP_HOST'] = 'vagrant.local';
32+
}
33+
}
34+
35+
// ========================
36+
// Custom Content Directory
37+
// ========================
38+
defined('WP_CONTENT_DIR') or define( 'WP_CONTENT_DIR', $chassisdir . '/content' );
39+
defined('WP_CONTENT_URL') or define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/content' );
40+
41+
// =====================
42+
// URL hacks for Vagrant
43+
// =====================
44+
if ( WP_LOCAL_DEV && ! defined('WP_SITEURL') ) {
45+
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/wp');
46+
47+
if ( ! defined( 'WP_HOME' ) ) {
48+
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);
49+
}
50+
}
51+
52+
// ================================================
53+
// You almost certainly do not want to change these
54+
// ================================================
55+
define( 'DB_CHARSET', 'utf8' );
56+
define( 'DB_COLLATE', '' );
57+
58+
// ==============================================================
59+
// Table prefix
60+
// Change this if you have multiple installs in the same database
61+
// ==============================================================
62+
if ( empty( $table_prefix ) )
63+
$table_prefix = 'sztests_';
64+
65+
// =====================================
66+
// Errors
67+
// Show/hide errors for local/production
68+
// =====================================
69+
defined( 'WP_DEBUG' ) or define( 'WP_DEBUG', true );
70+
71+
define( 'WP_TESTS_DOMAIN', 'example.org' );
72+
define( 'WP_TESTS_EMAIL', '[email protected]' );
73+
define( 'WP_TESTS_TITLE', 'Test Blog' );
74+
75+
define( 'WP_PHP_BINARY', 'php' );
76+
77+
// ===================
78+
// Bootstrap WordPress
79+
// ===================
80+
if ( !defined( 'ABSPATH' ) )
81+
define( 'ABSPATH', $chassisdir . '/wp/' );

wpdevel

Submodule wpdevel added at 598e794

0 commit comments

Comments
 (0)