public function testTestUsersCreation(ApiTester $I) { $I->wantTo('make sure my test users have been created'); $I->amHttpAuthenticated('admin', 'admin'); $I->sendGET($this->baseUrl . '/users/' . $this->userId); $I->seeResponseCodeIs(200); $I->seeResponseIsXml(); $I->seeXmlResponseIncludes(XmlUtils::toXml(['status' => 'ok'])); $I->sendGET($this->baseUrl . '/users/' . $this->sharerUserId); $I->seeResponseCodeIs(200); $I->seeResponseIsXml(); $I->seeXmlResponseIncludes(XmlUtils::toXml(['status' => 'ok'])); }
public function deleteUser(ApiTester $I, \Codeception\Scenario $scenario) { //$scenario->skip('ownCloud master is broken'); $I->wantTo('delete the user'); $I->amHttpAuthenticated('admin', 'admin'); $I->haveHttpHeader('Content-Type', 'application/x-www-form-urlencoded'); $I->sendDELETE($this->apiUrl . '/users/' . $this->userId); $I->seeResponseCodeIs(200); $I->seeResponseIsXml(); $I->seeXmlResponseIncludes(XmlUtils::toXml(['status' => 'ok'])); }
<?php $I = new ApiTester($scenario); $I->am('Saman IT employee!'); $I->wantTo('test GetProductInfo method on this webservice'); $I->haveHttpHeader('Content-Type', 'text/xml'); $I->sendPOST('/webservice.php', '<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Body> <GetProductInfo xmlns="http://example.com/nikapps/samanussd/soap/samansoapserver"> <productCode>123213</productCode> <languageCode>Fa</languageCode> </GetProductInfo> </Body> </Envelope>'); $I->seeResponseIsXml(); $I->seeResponseContains('<Result>1;1000;Ok!</Result>');