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: b272eaa
Choose a base ref
...
head repository: mantisbt/mantisbt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4a3268a
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Nov 14, 2011

  1. Revert "SOAP Tests: update to use the new date format"

    This reverts commit 6cd4123 , which
    introduced whitespace errors.
    rombert committed Nov 14, 2011
    Copy the full SHA
    b95f109 View commit details
  2. Copy the full SHA
    4a3268a View commit details
Showing with 106 additions and 106 deletions.
  1. +53 −53 tests/soap/IssueAddTest.php
  2. +53 −53 tests/soap/IssueUpdateTest.php
106 changes: 53 additions & 53 deletions tests/soap/IssueAddTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
# MantisBT - a php based bugtracking system
# MantisBT - A PHP based bugtracking system

# MantisBT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -32,7 +32,7 @@ class IssueAddTest extends SoapBase {
* 1. Ability to create an issue with only the mandatory parameters.
* 2. mc_issue_get_biggest_id()
* 3. mc_issue_get_id_from_summary()
* 4. The defaulting of the non-mandatory parameters.
* 4. The defaulting of the non-mandatory parameters.
*/
public function testCreateIssue() {
$issueToAdd = $this->getIssueToAdd( 'IssueAddTest.testCreateIssue' );
@@ -41,7 +41,7 @@ public function testCreateIssue() {
$this->userName,
$this->password,
$issueToAdd);

$this->deleteAfterRun( $issueId );

$issueExists = $this->client->mc_issue_exists(
@@ -106,14 +106,14 @@ public function testCreateIssue() {
public function testCreateIssueWithHtmlMarkup() {
$issueToAdd = $this->getIssueToAdd( 'IssueAddTest.testCreateIssueWithHtmlMarkup' );

$issueToAdd['summary'] .= " <b>WithHtmlMarkup</b>";
$issueToAdd['description'] .= " <b>WithHtmlMarkup</b>";
$issueToAdd['summary'] .= " <strong>WithHtmlMarkup</strong>";
$issueToAdd['description'] .= " <strong>WithHtmlMarkup</strong>";

$issueId = $this->client->mc_issue_add(
$this->userName,
$this->password,
$issueToAdd);

$this->deleteAfterRun( $issueId );

$issue = $this->client->mc_issue_get(
@@ -126,14 +126,14 @@ public function testCreateIssueWithHtmlMarkup() {
$this->assertEquals( $issueToAdd['description'], $issue->description );

}

/**
* This issue tests the following:
* 1. Creating an issue with some fields that are typically not used at creation time.
* For example: projection, eta, resolution, status, fixed_in_version, and target_version.
* 2. Get the issue and confirm that all fields are set as expected.
* 3. Delete the issue.
*
*
* This test case was added for bug #9132.
*/
public function testCreateIssueWithRareFields() {
@@ -150,7 +150,7 @@ public function testCreateIssueWithRareFields() {
$this->userName,
$this->password,
$issueToAdd);

$this->deleteAfterRun( $issueId );

$issue = $this->client->mc_issue_get(
@@ -177,7 +177,7 @@ public function testCreateIssueWithRareFields() {
*/
public function testCreateIssueWithHandler() {

$adminUsers = $this->client->mc_project_get_users($this->userName, $this->password, $this->getProjectId(), 90);
$adminUsers = $this->client->mc_project_get_users($this->userName, $this->password, $this->getProjectId(), 90);

$this->assertTrue(count($adminUsers) >= 1 , "count(adminUsers) >= 1");

@@ -191,7 +191,7 @@ public function testCreateIssueWithHandler() {
$this->userName,
$this->password,
$issueToAdd);

$this->deleteAfterRun( $issueId );

$issue = $this->client->mc_issue_get(
@@ -201,112 +201,112 @@ public function testCreateIssueWithHandler() {

$this->assertEquals( $adminUser->id, $issue->handler->id, 'handler.id' );
}

/**
* This issue tests the following
*
*
* 1. Creating an issue with a due date
* 2. Retrieving the issue
* 3. Validating that the due date is properly set
*/
public function testCreateIssueWithDueDate() {

$this->skipIfDueDateIsNotEnabled();

$date = '2015-10-29T12:59:14+00:00';

$issueToAdd = $this->getIssueToAdd( 'IssueAddTest.testCreateIssueWithDueDate' );

$issueToAdd['due_date'] = $date;

$issueId = $this->client->mc_issue_add(
$this->userName,
$this->password,
$issueToAdd);
$this->deleteAfterRun( $issueId );

$this->deleteAfterRun( $issueId );

$issue = $this->client->mc_issue_get(
$this->userName,
$this->password,
$issueId);


$this->assertEquals( $date, $issue->due_date, "due_date");
}

/**
* This issue tests the following
*
*
* 1. Creating an issue without a due date
* 2. Retrieving the issue
* 3. Validating that the due date is properly encoded as null
*
*
* This stricter verification originates in some SOAP frameworks, notably
* Axis, not accepting the empty tag format sent by nusoap by default, which
* is accepted by the PHP5 SOAP extension nevertheless.
*/
public function testCreateIssueWithNullDueDate() {
$issueToAdd = $this->getIssueToAdd( 'IssueAddTest.testCreateIssueWithNullDueDate' );

$issueId = $this->client->mc_issue_add(
$this->userName,
$this->password,
$issueToAdd);
$this->deleteAfterRun( $issueId );

$this->deleteAfterRun( $issueId );

$issue = $this->client->mc_issue_get(
$this->userName,
$this->password,
$issueId);

$this->assertNull( $issue->due_date , 'due_date is not null' );
$this->assertEquals( 'true', $this->readDueDate( $this->client->__getLastResponse() ) , 'xsi:nil not set to true' );
}

/**
* This issue tests the following
*
*
* 1. Creating an issue with no category
* 2. Retrieving the issue
* 3. Verifying that the category is empty.
*
*
*/
public function testCreateBugWithNoCategory() {
$this->skipIfAllowNoCategoryIsDisabled();

$issueToAdd = $this->getIssueToAdd( 'IssueAddTest.testCreateBugWithNoCategory' );
unset ( $issueToAdd['category'] );

$issueId = $this->client->mc_issue_add(
$this->userName,
$this->password,
$issueToAdd);
$this->deleteAfterRun( $issueId );

$this->deleteAfterRun( $issueId );

$issue = $this->client->mc_issue_get(
$this->userName,
$this->password,
$issueId);

$this->assertEquals( '', $issue->category, 'category' );

}

/**
*
*
* @param string $issueDataXml
* @return string the xsi:null value
*/
private function readDueDate( $issueDataXml ) {
$reader = new XMLReader();
$reader = new XMLReader();
$reader->XML( $this->client->__getLastResponse());

while ( $reader->read() ) {
switch ( $reader->nodeType ) {

case XMLReader::ELEMENT:
if ( $reader->name == 'due_date') {
return $reader->getAttribute( 'xsi:nil' );
@@ -316,15 +316,15 @@ private function readDueDate( $issueDataXml ) {
}
return null;
}

/**
* A test cases that tests the creation of issues
* A test cases that tests the creation of issues
* with a note passed in which contains time tracking data.
*/
public function testCreateIssueWithTimeTrackingNote() {

$this->skipIfTimeTrackingIsNotEnabled();

$issueToAdd = $this->getIssueToAdd( 'testCreateIssueWithNote' );
$issueToAdd['notes'] = array(
array(
@@ -347,24 +347,24 @@ public function testCreateIssueWithTimeTrackingNote() {
$this->assertEquals( 1, count( $issue->notes ) );

$note = $issue->notes[0];

$this->assertEquals( 30, $note->time_tracking );

$this->client->mc_issue_delete(
$this->userName,
$this->password,
$issueId);
}

/**
* This issue tests the following
*
*
* 1. Creating an issue where the handler is given by name
* 2. Retrieving the issue
* 3. Verifying that the handler name is correctly set
*/
public function testCreateIssueWithHandlerByName() {

$issueToAdd = $this->getIssueToAdd( 'testCreateIssueWithHandlerByName' );
$issueToAdd['handler'] = array(
'name' => $this->userName
@@ -374,7 +374,7 @@ public function testCreateIssueWithHandlerByName() {
$this->userName,
$this->password,
$issueToAdd);

$this->deleteAfterRun( $issueId );

$issue = $this->client->mc_issue_get(
Loading