Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9e3d771
Choose a base ref
...
head repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 767ddf0
Choose a head ref
  • 2 commits
  • 8 files changed
  • 1 contributor

Commits on Dec 5, 2011

  1. Ensure compatibility with PHPUnit 3.6

    PHPUnit 3.6 no longer has the 'Framework' class we try to require. Instead,
    allow the execution to proceeed without loading the class, but leave the
    silent include_once for older versions.
    rombert committed Dec 5, 2011
    Copy the full SHA
    1734ba0 View commit details
  2. Fix #13647 : Support sticky field

    Conflicts:
    
    	api/soap/mc_issue_api.php
    rombert committed Dec 5, 2011
    Copy the full SHA
    767ddf0 View commit details
1 change: 1 addition & 0 deletions api/soap/mantisconnect.php
Original file line number Diff line number Diff line change
@@ -289,6 +289,7 @@
'custom_fields' => array( 'name' => 'custom_fields', 'type' => 'tns:CustomFieldValueForIssueDataArray', 'minOccurs' => '0' ),
'due_date' => array( 'name' => 'due_date', 'type' => 'xsd:dateTime', 'minOccurs' => '0' ),
'monitors' => array( 'name' => 'monitors', 'type' => 'tns:AccountDataArray', 'minOccurs' => '0'),
'sticky' => array( 'name' => 'sticky', 'type' => 'xsd:boolean', 'minOccurs' => '0'),
'tags' => array( 'name' => 'tags', 'type' => 'tns:ObjectRefArray', 'minOccurs' => '0')
)
);
12 changes: 11 additions & 1 deletion api/soap/mc_issue_api.php
Original file line number Diff line number Diff line change
@@ -87,6 +87,7 @@ function mc_issue_get( $p_username, $p_password, $p_issue_id ) {
$t_issue_data['os_build'] = mci_null_if_empty( $t_bug->os_build );
$t_issue_data['reproducibility'] = mci_enum_get_array_by_id( $t_bug->reproducibility, 'reproducibility', $t_lang );
$t_issue_data['date_submitted'] = timestamp_to_iso8601( $t_bug->date_submitted, false );
$t_issue_data['sticky'] = $t_bug->sticky;

$t_issue_data['sponsorship_total'] = $t_bug->sponsorship_total;

@@ -629,7 +630,11 @@ function mc_issue_add( $p_username, $p_password, $p_issue ) {
$t_bug_data->view_state = $t_view_state_id;
$t_bug_data->summary = $t_summary;
$t_bug_data->sponsorship_total = isset( $p_issue['sponsorship_total'] ) ? $p_issue['sponsorship_total'] : 0;

if ( isset ( $p_issue['sticky']) &&
access_has_project_level( config_get( 'set_bug_sticky_threshold', null, null, $t_project_id ), $t_project_id ) ) {
$t_bug_data->sticky = $p_issue['sticky'];
}

if ( isset( $p_issue['due_date'] ) && access_has_global_level( config_get( 'due_date_update_threshold' ) ) ) {
$t_bug_data->due_date = mci_iso8601_to_timestamp( $p_issue['due_date'] );
} else {
@@ -808,6 +813,9 @@ function mc_issue_update( $p_username, $p_password, $p_issue_id, $p_issue ) {
$t_bug_data->version = $p_issue['version'];
if ( isset ( $p_issue['fixed_in_version'] ) )
$t_bug_data->fixed_in_version = $p_issue['fixed_in_version'];
if ( isset ( $p_issue['sticky']) && access_has_bug_level( config_get( 'set_bug_sticky_threshold' ), $t_bug_data->id ) ) {
$t_bug_data->sticky = $p_issue['sticky'];
}

if ( isset( $p_issue['due_date'] ) && access_has_global_level( config_get( 'due_date_update_threshold' ) ) ) {
$t_bug_data->due_date = mci_iso8601_to_timestamp( $p_issue['due_date'] );
@@ -1279,6 +1287,8 @@ function mci_issue_data_as_array( $p_issue_data, $p_user_id, $p_lang ) {
$t_issue['os_build'] = mci_null_if_empty( $p_issue_data->os_build );
$t_issue['reproducibility'] = mci_enum_get_array_by_id( $p_issue_data->reproducibility, 'reproducibility', $p_lang );
$t_issue['date_submitted'] = timestamp_to_iso8601( $p_issue_data->date_submitted, false );
$t_issue['sticky'] = $p_issue_data->sticky;

$t_issue['sponsorship_total'] = $p_issue_data->sponsorship_total;

if( !empty( $p_issue_data->handler_id ) ) {
2 changes: 0 additions & 2 deletions tests/Mantis/EnumTest.php
Original file line number Diff line number Diff line change
@@ -21,8 +21,6 @@
* @link http://www.mantisbt.org
*/

require_once 'PHPUnit/Framework.php';

require_once 'MantisEnum.class.php';

/**
4 changes: 0 additions & 4 deletions tests/Mantis/StringTest.php
Original file line number Diff line number Diff line change
@@ -21,10 +21,6 @@
* @link http://www.mantisbt.org
*/

require_once 'PHPUnit/Framework.php';

//require_once 'string_api.php';

class Mantis_StringTest extends PHPUnit_Framework_TestCase {

/**
4 changes: 2 additions & 2 deletions tests/TestConfig.php
Original file line number Diff line number Diff line change
@@ -28,9 +28,9 @@
ob_start();

/*
* Include PHPUnit dependencies
* Include PHPUnit dependencies ; insure compatibility with 3.5 and 3.6
*/
require_once 'PHPUnit/Framework.php';
@include_once 'PHPUnit/Framework.php';
/*
* Set error reporting to the level to which Zend Framework code must comply.
*/
3 changes: 3 additions & 0 deletions tests/soap/IssueAddTest.php
Original file line number Diff line number Diff line change
@@ -96,6 +96,7 @@ public function testCreateIssue() {
$this->assertEquals( 'none', $issue->eta->name );
$this->assertEquals( 10, $issue->resolution->id );
$this->assertEquals( 'open', $issue->resolution->name );
$this->assertEquals( 0, $issue->sticky );

}

@@ -145,6 +146,7 @@ public function testCreateIssueWithRareFields() {
$issueToAdd['status'] = array( 'id' => 40 ); // confirmed
$issueToAdd['fixed_in_version'] = 'fixed version';
$issueToAdd['target_version'] = 'target version';
$issueToAdd['sticky'] = 1;

$issueId = $this->client->mc_issue_add(
$this->userName,
@@ -165,6 +167,7 @@ public function testCreateIssueWithRareFields() {
$this->assertEquals( $issueToAdd['status']['id'], $issue->status->id );
$this->assertEquals( $issueToAdd['fixed_in_version'], $issue->fixed_in_version );
$this->assertEquals( $issueToAdd['target_version'], $issue->target_version );
$this->assertEquals( $issueToAdd['sticky'], $issue->sticky );
}

/**
2 changes: 2 additions & 0 deletions tests/soap/IssueUpdateTest.php
Original file line number Diff line number Diff line change
@@ -112,6 +112,7 @@ public function testUpdateSummaryBasedOnMandatoryFields() {
$this->deleteAfterRun( $issueId );

$issueToUpdate = $this->getIssueToAdd( 'IssueUpdateTest.testUpdateSummaryBasedOnMandatoryFields' );
$issueToUpdate['sticky'] = '1';

$this->client->mc_issue_update(
$this->userName,
@@ -131,6 +132,7 @@ public function testUpdateSummaryBasedOnMandatoryFields() {
$this->assertEquals( $issueToUpdate['summary'], $issue->summary );
$this->assertEquals( $issueToUpdate['description'], $issue->description );
$this->assertEquals( $issueToUpdate['project']['id'], $issue->project->id );
$this->assertEquals( $issueToUpdate['sticky'], $issue->sticky );

// defaulted fields
$this->assertEquals( $issueId, $issue->id );
1 change: 0 additions & 1 deletion tests/soap/SoapBase.php
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@
* @link http://www.mantisbt.org
*/

require_once 'PHPUnit/Framework.php';

$t_root_path = dirname( dirname( dirname( __FILE__ ) ) ) . DIRECTORY_SEPARATOR;