Skip to content

Commit

Permalink
ConfigParserTest: swap assertEquals arguments
Browse files Browse the repository at this point in the history
Fix wrong order of arguments for assertEquals(): expected value comes
first, actual value second.

Issue #34379

Signed-off-by: Damien Regad <dregad@mantisbt.org>
  • Loading branch information
grummbeer committed Mar 31, 2024
1 parent c7225a9 commit 4e60470
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/Mantis/ConfigParserTest.php
Expand Up @@ -90,12 +90,12 @@ public function testArrays( $p_string ) {
# Check that the parsed array matches the model array
$t_parser = new ConfigParser( $p_string );
$t_parsed_1 = $t_parser->parse();
$this->assertEquals( $t_parsed_1, $t_reference_result, $this->errorMessage( $p_string ) );
$this->assertEquals( $t_reference_result, $t_parsed_1, $this->errorMessage( $p_string ) );

# Export converted array and parse again: result should match the model
$t_parser = new ConfigParser( var_export( $t_parsed_1 , true ) );
$t_parsed_2 = $t_parser->parse();
$this->assertEquals( $t_parsed_2, $t_reference_result, $this->errorMessage( $p_string ) );
$this->assertEquals( $t_reference_result, $t_parsed_2, $this->errorMessage( $p_string ) );
}

/**
Expand All @@ -122,11 +122,11 @@ public function testExtraTokensError() {
public function testExtraTokensIgnore() {
$t_parser = new ConfigParser( '1; 2' );
$t_result = $t_parser->parse( ConfigParser::EXTRA_TOKENS_IGNORE );
$this->assertEquals( $t_result, 1 );
$this->assertEquals( 1, $t_result);

$t_parser = new ConfigParser( 'array(); 2' );
$t_result = $t_parser->parse( ConfigParser::EXTRA_TOKENS_IGNORE );
$this->assertEquals( $t_result, array() );
$this->assertEquals( array(), $t_result);
}

/**
Expand Down

0 comments on commit 4e60470

Please sign in to comment.