Skip to content

Commit

Permalink
fix phpunit noise
Browse files Browse the repository at this point in the history
  • Loading branch information
nigel-bmlt committed Apr 7, 2022
1 parent 2e376d6 commit 49aadad
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/REST/Handlers/ServiceBodiesHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ public function get_service_bodies_handler($request)
// $wbw_dbg->debug_log($wbw_dbg->vdump($sblist));

}
$wbw_dbg->debug_log("DEBUG SERVICE BODY");
$wbw_dbg->debug_log($wbw_dbg->vdump($this->handlerCore->wbw_rest_success($sblist)));
// $wbw_dbg->debug_log("DEBUG SERVICE BODY");
// $wbw_dbg->debug_log($wbw_dbg->vdump($this->handlerCore->wbw_rest_success($sblist)));
return $this->handlerCore->wbw_rest_success($sblist);

// return $sblist;
Expand Down
12 changes: 8 additions & 4 deletions tests/src/DebugTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ protected function tearDown(): void
*/
public function test_debug_log_enabled(): void
{
$dbg = new Debug();
Functions\expect('error_log')->once();

$dbg->debug_log("hi");
if(WBW_DEBUG)
{
$dbg = new Debug();
Functions\expect('error_log')->once();

$dbg->debug_log("hi");

}
$this->assertTrue(true);
}

Expand Down
5 changes: 5 additions & 0 deletions tests/src/REST/Handlers/SubmissionsHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ protected function setUp(): void
require_once($basedir . '/vendor/cyruscollier/wordpress-develop/src/wp-includes/class-wp-error.php');
require_once($basedir . '/vendor/cyruscollier/wordpress-develop/src/wp-includes/class-wp-http-response.php');
require_once($basedir . '/vendor/cyruscollier/wordpress-develop/src/wp-includes/rest-api/class-wp-rest-response.php');
require_once($basedir . '/vendor/cyruscollier/wordpress-develop/src/wp-includes/rest-api/class-wp-rest-request.php');
require_once($basedir . '/vendor/cyruscollier/wordpress-develop/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php');
if (!class_exists('wpdb')){
require_once($basedir . '/vendor/cyruscollier/wordpress-develop/src/wp-includes/wp-db.php');
}

Brain\Monkey\setUp();
Functions\when('sanitize_text_field')->returnArg();
Functions\when('sanitize_email')->returnArg();
Expand Down

0 comments on commit 49aadad

Please sign in to comment.