Skip to content

Commit 63e1a06

Browse files
build: fail if samples folder does not exist
1 parent 140f6b1 commit 63e1a06

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

tests/test-import.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ public function test_db_import() {
232232
* @access public
233233
*/
234234
public function fileProvider() {
235+
$this->assertFileExists( VISUALIZER_ABSPATH . DIRECTORY_SEPARATOR . 'samples', 'Folder "samples" does not exist' );
236+
235237
$file = VISUALIZER_ABSPATH . DIRECTORY_SEPARATOR . 'samples' . DIRECTORY_SEPARATOR . 'bar.csv';
236238
list( $content, $series ) = $this->parseFile( $file );
237239

@@ -305,6 +307,8 @@ private function parseFile( $file, $multiplyValuesBy = 1 ) {
305307
* @access public
306308
*/
307309
public function urlProvider() {
310+
$this->assertFileExists( VISUALIZER_ABSPATH . DIRECTORY_SEPARATOR . 'samples', 'Folder "samples" does not exist' );
311+
308312
$url = 'https://demo.themeisle.com/wp-content/plugins/visualizer/samples/bar.csv';
309313
$file = download_url( $url );
310314
list( $content, $series ) = $this->parseFile( $file );

tests/test-revisions.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ public function test_chart_edit_save( $file_orig, $file_new ) {
272272
* @access public
273273
*/
274274
public function fileProvider() {
275+
$this->assertFileExists( VISUALIZER_ABSPATH . DIRECTORY_SEPARATOR . 'samples', 'Folder "samples" does not exist' );
276+
275277
return array(
276278
array( VISUALIZER_ABSPATH . DIRECTORY_SEPARATOR . 'samples' . DIRECTORY_SEPARATOR . 'line.csv', VISUALIZER_ABSPATH . DIRECTORY_SEPARATOR . 'samples' . DIRECTORY_SEPARATOR . 'bar.csv' ),
277279
);

0 commit comments

Comments
 (0)