Code Duplication    Length = 10-11 lines in 6 locations

vendor/developerforce/force.com-toolkit-for-php/test/SforcePartnerClientTest.php 6 locations

@@ 126-135 (lines=10) @@
123
    }
124
  }
125
126
  public function testServerTimestamp() {
127
    echo "testServerTimestamp\r\n";
128
    try {
129
      $timeStamp = $this->mySforceConnection->getServerTimestamp();
130
      $this->assertNotNull($timeStamp);
131
      $this->assertNotNull($timeStamp->timestamp);
132
    } catch (SoapFault $fault) {
133
      $this->fail($fault->faultstring);
134
    }
135
  }
136
137
  public function testUserInfo() {
138
    echo "testUserInfo\r\n";
@@ 137-147 (lines=11) @@
134
    }
135
  }
136
137
  public function testUserInfo() {
138
    echo "testUserInfo\r\n";
139
    try {
140
      $userInfo = $this->mySforceConnection->getUserInfo();
141
      $this->assertNotNull($userInfo);
142
      $this->assertNotNull($userInfo->userId);
143
      $this->assertNotNull($userInfo->userFullName);
144
    } catch (SoapFault $fault) {
145
      $this->fail($fault->faultstring);
146
    }
147
  }
148
149
  public function testDescribeSObject() {
150
    echo "testDescribeSObject\r\n";
@@ 149-159 (lines=11) @@
146
    }
147
  }
148
149
  public function testDescribeSObject() {
150
    echo "testDescribeSObject\r\n";
151
    try {
152
      $response = $this->mySforceConnection->describeSObject('Contact');
153
      $this->assertNotNull($response);
154
      $this->assertEquals('Contact', $response->name);
155
    } catch (SoapFault $fault) {
156
      echo $fault;
157
      $this->fail($fault->faultstring);
158
    }
159
  }
160
161
  public function testDescribeSObjects() {
162
    echo "testDescribeSObjects\r\n";
@@ 175-184 (lines=10) @@
172
    }
173
  }
174
175
  public function testDescribeGlobal() {
176
    echo "testDescribeGlobal\r\n";
177
    try {
178
      $response = $this->mySforceConnection->describeGlobal();
179
      $this->assertNotNull($response);
180
      $this->assertNotNull($response->types);
181
    } catch (SoapFault $fault) {
182
      $this->fail($fault->faultstring);
183
    }
184
  }
185
186
  public function testDescribeLayout() {
187
    echo "testDescribeLayout\r\n";
@@ 186-195 (lines=10) @@
183
    }
184
  }
185
186
  public function testDescribeLayout() {
187
    echo "testDescribeLayout\r\n";
188
    try {
189
      $response = $this->mySforceConnection->describeLayout('Contact');
190
      $this->assertNotNull($response);
191
      $this->assertNotNull($response->recordTypeMappings);
192
    } catch (SoapFault $fault) {
193
      $this->fail($fault->faultstring);
194
    }
195
  }
196
197
  public function testDescribeTabs() {
198
    echo "testDescribeTabs\r\n";
@@ 197-206 (lines=10) @@
194
    }
195
  }
196
197
  public function testDescribeTabs() {
198
    echo "testDescribeTabs\r\n";
199
    try {
200
      $response = $this->mySforceConnection->describeTabs();
201
      $this->assertNotNull($response);
202
      $this->assertTrue(sizeof($response) > 0);
203
    } catch (SoapFault $fault) {
204
      $this->fail($fault->faultstring);
205
    }
206
  }
207
208
  public function testCreate() {
209
    // now done in setUp so that theId can be accessed by other tests.