Skip to content

Commit 5a30e85

Browse files
committed
fix: pr review changes
1 parent 3c603d5 commit 5a30e85

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

classes/Visualizer/Module.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ private function _getCSV( $rows, $filename, $enclose ) {
277277
$fp = fopen( wp_tempnam(), 'w+' );
278278
}
279279
if ( ! $fp ) {
280-
return array( 'csv' => '', 'name' => $filename, 'string' => '' );
280+
return null;
281281
}
282282
if ( ! apply_filters( 'vizualizer_export_include_series_type', true ) ) {
283283
unset( $rows[1] );

tests/test-export.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private function create_chart() {
6464
* @since 3.11.0
6565
*
6666
* @access private
67-
* @return object
67+
* @return object|null
6868
*/
6969
private function run_export() {
7070
$_GET = array(
@@ -115,6 +115,9 @@ public function test_csv_export_response_structure() {
115115
$this->_setRole( 'administrator' );
116116

117117
$response = $this->run_export();
118+
$this->assertIsObject( $response );
119+
$this->assertTrue( property_exists( $response, 'success' ) );
120+
$this->assertTrue( property_exists( $response, 'data' ) );
118121
$this->assertTrue( $response->success );
119122

120123
$data = $response->data;

0 commit comments

Comments
 (0)