Skip to content

Commit 33374d5

Browse files
committed
Add a test content dir
1 parent 2ed326b commit 33374d5

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tests/integration/ITEnv.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,24 @@ class ITEnv {
1010

1111
final private function __construct() { }
1212

13+
/**
14+
* Return directory used for adding test content
15+
* files.
16+
*/
17+
public static function getTestContentDir(): string {
18+
$dir = self::getWordPressDir() . self::getTestContentPath();
19+
mkdir( $dir, 0777, true );
20+
return $dir;
21+
}
22+
23+
/**
24+
* Return relative URL path where test content files
25+
* should appear on the site.
26+
*/
27+
public static function getTestContentPath(): string {
28+
return '/wp-content/tstcontent';
29+
}
30+
1331
public static function getWordPressDir(): string
1432
{
1533
if ( ! isset( self::$wordpress_dir ) ) {

tests/integration/ITTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
*/
88
trait ITTrait {
99
public function setUp(): void {
10+
exec( 'rm -rf ' . escapeshellarg( ITEnv::getTestContentDir() ) );
11+
1012
$this->wpCli( [ 'wp2static', 'delete_all_cache', '--force' ] );
1113
}
1214

0 commit comments

Comments
 (0)