Skip to content

Commit

Permalink
bugfix(devs): atualizado os testes PHP para mockar a função de conseg…
Browse files Browse the repository at this point in the history
…uir a rua e cidade (novamente novamente)
  • Loading branch information
MarcosViniciusG committed Jul 3, 2024
1 parent 1261cb0 commit 7cdfb0f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions tests/php/AlteraStatusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function test_atualizar_formulario_success() {
'latitude' => '12.345678',
'longitude' => '98.7654321',
'road' => 'Mock Rua',
'city' => 'Mock Cidade',
'city' => 'Mock Cidade'
]),
$this->equalTo(['id' => 1])
)
Expand All @@ -99,8 +99,12 @@ public function test_atualizar_formulario_missing_data() {
$this->expectException(WPDieException::class);
$this->expectExceptionMessage('Dados insuficientes');

$mock_conseguir_rua_e_cidade = function($latitude, $longitude) {
return ['Mock Rua', 'Mock Cidade'];
};

// Chame a função atualizar_formulario e verifique se wp_die é chamado
atualizar_formulario($this->wpdb);
atualizar_formulario($this->wpdb, $mock_conseguir_rua_e_cidade);
}

// Testes para a função alteraStatus
Expand Down

0 comments on commit 7cdfb0f

Please sign in to comment.