mirror of
https://gh.wpcy.net/https://github.com/bbpress/wp-cli-bbpress.git
synced 2026-05-13 20:29:27 +08:00
27 lines
626 B
PHP
27 lines
626 B
PHP
<?php
|
|
|
|
use Behat\Gherkin\Node\PyStringNode,
|
|
Behat\Gherkin\Node\TableNode,
|
|
WP_CLI\Process;
|
|
|
|
$steps->Given( '/^a bbPress install$/',
|
|
function ( $world ) {
|
|
$world->install_wp();
|
|
$dest_dir = $world->variables['RUN_DIR'] . '/wp-content/plugins/bbpress/';
|
|
if ( ! is_dir( $dest_dir ) ) {
|
|
mkdir( $dest_dir );
|
|
}
|
|
|
|
$bbp_src_dir = getenv( 'BBP_SRC_DIR' );
|
|
|
|
if ( ! is_dir( $bbp_src_dir ) ) {
|
|
throw new Exception( 'bbPress not found in BBP_SRC_DIR' );
|
|
}
|
|
|
|
try {
|
|
$world->copy_dir( $bbp_src_dir, $dest_dir );
|
|
$world->proc( 'wp plugin activate bbpress' )->run_check();
|
|
|
|
} catch ( Exception $e ) {};
|
|
}
|
|
);
|