Permalink
Browse files

soap tests: fix whitespace

  • Loading branch information...
1 parent f1a60e6 commit a9ac81aa8f83e2151ce94a1df9235a4c83224996 @dregad dregad committed with dregad May 6, 2013
Showing with 75 additions and 75 deletions.
  1. +3 −3 tests/soap/AttachmentTest.php
  2. +72 −72 tests/soap/VersionTest.php
@@ -126,12 +126,12 @@ public function testProjectAttachmentIsAdded() {
$this->userName,
$this->password,
$attachmentId);
-
+
$this->assertEquals( $attachmentContents, base64_decode( $attachment ), '$attachmentContents' );
-
+
$attachments = $this->client->mc_project_get_attachments( $this->userName, $this->password, $this->getProjectId() );
$this->assertEquals( 1, count( $attachments ) );
-
+
$attachment = $attachments[0];
$this->assertEquals($this->userId, $attachment->user_id);
$this->assertEquals('description', $attachment->description);
View
@@ -27,84 +27,84 @@
* Test fixture for version methods
*/
class VersionTest extends SoapBase {
-
+
const DATE_ORDER = '2015-10-29T12:59:14+00:00';
- private function getTestVersion() {
+ private function getTestVersion() {
- return array (
+ return array (
'project_id' => $this->getProjectId(),
'name' => '1.0',
'released' => true,
'description' => 'Test version',
- 'obsolete' => false,
- 'date_order'=> self::DATE_ORDER
+ 'obsolete' => false,
+ 'date_order'=> self::DATE_ORDER
);
- }
-
- /**
- * Tests creating a new version
- */
- public function testAddVersion() {
-
- $initialVersions = $this->countVersions();
-
- $versionId = $this->client->mc_project_version_add($this->userName, $this->password, $this->getTestVersion() );
-
- $this->assertNotNull( $versionId );
-
- $this->deleteVersionAfterRun( $versionId );
-
- $versions = $this->client->mc_project_get_versions( $this->userName, $this->password, $this->getProjectId() );
-
- $this->assertEquals(1, count($versions) - $initialVersions);
-
- $version = $versions[0];
-
- $this->assertEquals('1.0', $version->name);
- $this->assertEquals(true, $version->released);
- $this->assertEquals('Test version', $version->description);
- $this->assertEquals($this->getProjectId(), $version->project_id);
- $this->assertEquals(self::DATE_ORDER, $version->date_order);
- $this->assertEquals(false, $version->obsolete);
- }
-
-
- /**
- * Tests updating a version
- */
- public function testUpdateVersion() {
-
- $initialVersions = $this->countVersions();
-
- $versionId = $this->client->mc_project_version_add($this->userName, $this->password, $this->getTestVersion() );
-
- $this->assertNotNull( $versionId );
-
- $this->deleteVersionAfterRun( $versionId );
-
- $updatedVersion = $this->getTestVersion();
- $updatedVersion['name'] = '1.1';
-
- $this->client->mc_project_version_update ( $this->userName, $this->password, $versionId, $updatedVersion );
-
- $versions = $this->client->mc_project_get_versions( $this->userName, $this->password, $this->getProjectId() );
-
- $this->assertEquals(1, count($versions) - $initialVersions);
-
- foreach ( $versions as $version ) {
- if ( $version->id == $versionId ) {
- $this->assertEquals('1.1', $version->name);
- $this->assertEquals(self::DATE_ORDER, $version->date_order);
- return;
- }
- }
-
- self::fail('Did not find version with id ' . $versionId . ' in the reply');
- }
-
- private function countVersions() {
-
- return count ( $this->client->mc_project_get_versions( $this->userName, $this->password, $this->getProjectId() ) );
- }
+ }
+
+ /**
+ * Tests creating a new version
+ */
+ public function testAddVersion() {
+
+ $initialVersions = $this->countVersions();
+
+ $versionId = $this->client->mc_project_version_add($this->userName, $this->password, $this->getTestVersion() );
+
+ $this->assertNotNull( $versionId );
+
+ $this->deleteVersionAfterRun( $versionId );
+
+ $versions = $this->client->mc_project_get_versions( $this->userName, $this->password, $this->getProjectId() );
+
+ $this->assertEquals(1, count($versions) - $initialVersions);
+
+ $version = $versions[0];
+
+ $this->assertEquals('1.0', $version->name);
+ $this->assertEquals(true, $version->released);
+ $this->assertEquals('Test version', $version->description);
+ $this->assertEquals($this->getProjectId(), $version->project_id);
+ $this->assertEquals(self::DATE_ORDER, $version->date_order);
+ $this->assertEquals(false, $version->obsolete);
+ }
+
+
+ /**
+ * Tests updating a version
+ */
+ public function testUpdateVersion() {
+
+ $initialVersions = $this->countVersions();
+
+ $versionId = $this->client->mc_project_version_add($this->userName, $this->password, $this->getTestVersion() );
+
+ $this->assertNotNull( $versionId );
+
+ $this->deleteVersionAfterRun( $versionId );
+
+ $updatedVersion = $this->getTestVersion();
+ $updatedVersion['name'] = '1.1';
+
+ $this->client->mc_project_version_update ( $this->userName, $this->password, $versionId, $updatedVersion );
+
+ $versions = $this->client->mc_project_get_versions( $this->userName, $this->password, $this->getProjectId() );
+
+ $this->assertEquals(1, count($versions) - $initialVersions);
+
+ foreach ( $versions as $version ) {
+ if ( $version->id == $versionId ) {
+ $this->assertEquals('1.1', $version->name);
+ $this->assertEquals(self::DATE_ORDER, $version->date_order);
+ return;
+ }
+ }
+
+ self::fail('Did not find version with id ' . $versionId . ' in the reply');
+ }
+
+ private function countVersions() {
+
+ return count ( $this->client->mc_project_get_versions( $this->userName, $this->password, $this->getProjectId() ) );
+ }
}

0 comments on commit a9ac81a

Please sign in to comment.