Skip to content

Commit

Permalink
issue #909: use assertObjectHasProperty
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriim committed Nov 14, 2024
1 parent 496d305 commit 11e9fa7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/tool_dataflows_connector_curl_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ public function test_execute() {
$this->assertEquals('3d188fbf-d0b7-4d4e-ae4d-4b5548df824e', $result->uuid);

$this->assertEquals(200, $vars->httpcode);
$this->assertObjectHasAttribute('connecttime', $vars);
$this->assertObjectHasAttribute('totaltime', $vars);
$this->assertObjectHasAttribute('sizeupload', $vars);
$this->assertObjectHasProperty('connecttime', $vars);
$this->assertObjectHasProperty('totaltime', $vars);
$this->assertObjectHasProperty('sizeupload', $vars);

$testurl = $this->get_mock_url('/test_post.php');

Expand Down Expand Up @@ -115,9 +115,9 @@ public function test_execute() {
$vars = $engine->get_variables_root()->get('steps.connector.vars');

$this->assertEquals(200, $vars->httpcode);
$this->assertObjectHasAttribute('connecttime', $vars);
$this->assertObjectHasAttribute('totaltime', $vars);
$this->assertObjectHasAttribute('sizeupload', $vars);
$this->assertObjectHasProperty('connecttime', $vars);
$this->assertObjectHasProperty('totaltime', $vars);
$this->assertObjectHasProperty('sizeupload', $vars);

// Tests put method.
$stepdef->config = Yaml::dump([
Expand Down Expand Up @@ -145,9 +145,9 @@ public function test_execute() {

// PUT has no response body so it shouldn't be checked.
$this->assertEquals(200, $vars->httpcode);
$this->assertObjectHasAttribute('connecttime', $vars);
$this->assertObjectHasAttribute('totaltime', $vars);
$this->assertObjectHasAttribute('sizeupload', $vars);
$this->assertObjectHasProperty('connecttime', $vars);
$this->assertObjectHasProperty('totaltime', $vars);
$this->assertObjectHasProperty('sizeupload', $vars);

$expectedbash = "curl -s -X PUT {$testurl} --max-time 30 --data-raw 'data=moodletest'";
$this->assertEquals($expectedbash, $variables->dbgcommand);
Expand Down

0 comments on commit 11e9fa7

Please sign in to comment.