Skip to content
Snippets Groups Projects
Commit 3e388f7b authored by Andy Summers's avatar Andy Summers
Browse files

Add `ExternalCustomerService` for external (e.g. parent) customers

parent 57f037c0
No related branches found
No related tags found
1 merge request!65Add `ExternalCustomerService` for external (e.g. parent) customers
Showing
with 968 additions and 1 deletion
{ {
"name": "adi-ia/cbs-techstore-client-php", "name": "adi-ia/cbs-techstore-client-php",
"description": "A PHP client used to connect with the CBS API and perform requests", "description": "A PHP client used to connect with the CBS API and perform requests",
"version": "6.0.0", "version": "6.1.0",
"license": "Apache-2.0", "license": "Apache-2.0",
"homepage": "https://wiki.doit.wisc.edu/confluence/display/ADIIA/CBS", "homepage": "https://wiki.doit.wisc.edu/confluence/display/ADIIA/CBS",
"authors": [ "authors": [
......
<?php
namespace edu\wisc\services\cbs\external_customer;
/**
* ExternalCustomer represents an external customer, for example, a Parent
*/
class ExternalCustomer
{
/** @var string */
private $customerType;
/** @var string */
private $customerIdentifier;
/** @var string */
private $firstName;
/** @var string */
private $lastName;
/** @var string */
private $email;
/** @var string */
private $phone;
/** @var string */
private $reference;
/** @var string */
private $testMode;
/**
* @return string
*/
public function getCustomerType()
{
return $this->customerType;
}
/**
* @param string $customerType
* @return ExternalCustomer
*/
public function setCustomerType($customerType)
{
$this->customerType = $customerType;
return $this;
}
/**
* @return string
*/
public function getCustomerIdentifier()
{
return $this->customerIdentifier;
}
/**
* @param string $customerIdentifier
* @return ExternalCustomer
*/
public function setCustomerIdentifier($customerIdentifier)
{
$this->customerIdentifier = $customerIdentifier;
return $this;
}
/**
* @return string
*/
public function getFirstName()
{
return $this->firstName;
}
/**
* @param string $firstName
* @return ExternalCustomer
*/
public function setFirstName($firstName)
{
$this->firstName = $firstName;
return $this;
}
/**
* @return string
*/
public function getLastName()
{
return $this->lastName;
}
/**
* @param string $lastName
* @return ExternalCustomer
*/
public function setLastName($lastName)
{
$this->lastName = $lastName;
return $this;
}
/**
* @return string
*/
public function getEmail()
{
return $this->email;
}
/**
* @param string $email
* @return ExternalCustomer
*/
public function setEmail($email)
{
$this->email = $email;
return $this;
}
/**
* @return string
*/
public function getPhone()
{
return $this->phone;
}
/**
* @param string $phone
* @return ExternalCustomer
*/
public function setPhone($phone)
{
$this->phone = $phone;
return $this;
}
/**
* @return string
*/
public function getReference()
{
return $this->reference;
}
/**
* @param string $reference
* @return ExternalCustomer
*/
public function setReference($reference)
{
$this->reference = $reference;
return $this;
}
/**
* @return string
*/
public function getTestMode()
{
return $this->testMode;
}
/**
* @param string $testMode
* @return ExternalCustomer
*/
public function setTestMode($testMode)
{
$this->testMode = $testMode;
return $this;
}
}
\ No newline at end of file
<?php
namespace edu\wisc\services\cbs\external_customer;
use edu\wisc\services\cbs\external_customer\generated\InputParameters;
/**
* Maps an {@link ExternalCustomer} to an {@link InputParameters}
*/
class ExternalCustomerInputParametersMapper
{
/**
* Maps an {@link ExternalCustomer} to {@link InputParameters}
* @param ExternalCustomer $customer
* @return InputParameters
*/
public static function toInputParameters(ExternalCustomer $customer)
{
return (new InputParameters(
'',
'',
'',
'',
'',
'',
'',
''
))
->setP_CUSTOMER_TYPE($customer->getCustomerType())
->setP_CUSTOMER_IDENTIFIER($customer->getCustomerIdentifier())
->setP_FIRST_NAME($customer->getFirstName())
->setP_LAST_NAME($customer->getLastName())
->setP_PHONE($customer->getPhone())
->setP_REFERENCE($customer->getReference())
->setP_TEST_MODE($customer->getTestMode());
}
}
\ No newline at end of file
<?php
namespace edu\wisc\services\cbs\external_customer;
/**
* Service intended to create external customers (e.g. Parents) in CBS
*/
interface ExternalCustomerService
{
/**
* @param ExternalCustomer $customer
* @return mixed
*/
public function createCustomer(ExternalCustomer $customer);
}
\ No newline at end of file
<?php
namespace edu\wisc\services\cbs\external_customer;
use edu\wisc\services\cbs\common\AbstractServiceResponse;
/**
* Represents a response from a {@link ExternalCustomerService}
*/
class ExternalCustomerServiceResponse extends AbstractServiceResponse
{
/** @var string */
private $customerNumber;
/** @var string */
private $status;
/** @var string */
private $resultMessage;
public function __construct($status, $resultMessage, $customerNumber)
{
parent::__construct($status, $resultMessage);
$this->customerNumber = $customerNumber;
}
/**
* @return string
*/
public function getCustomerNumber()
{
return $this->customerNumber;
}
/**
* @return string
*/
public function getStatus()
{
return $this->status;
}
/**
* @return string
*/
public function getResultMessage()
{
return $this->resultMessage;
}
}
\ No newline at end of file
<?php
namespace edu\wisc\services\cbs\external_customer;
/**
* Mock implementation of {@link ExternalCustomerService}
*/
class MockExternalCustomerService implements ExternalCustomerService
{
/** @var ExternalCustomerServiceResponse */
private $response;
/**
* MockExternalCustomerService constructor.
* @param ExternalCustomerServiceResponse|null $response
*/
public function __construct(ExternalCustomerServiceResponse $response = null)
{
if ($response !== null) {
$this->response = $response;
} else {
$this->response = new ExternalCustomerServiceResponse(
true,
'MockExternalCustomerServiceResponse',
'123456789'
);
}
}
/**
* {@inheritdoc}
*/
public function createCustomer(ExternalCustomer $customer)
{
return $this->response;
}
}
\ No newline at end of file
<?php
namespace edu\wisc\services\cbs\external_customer;
use edu\wisc\services\cbs\api\SoapService;
use edu\wisc\services\cbs\common\WssSoapHeaderBuilder;
use edu\wisc\services\cbs\external_customer\generated\DOIT_SOA_EXTERNAL_CUSTOMER_V2_Service;
/**
* SOAP backed implementation of {@link ExternalCustomerService}
*/
class SoapExternalCustomerService implements SoapService, ExternalCustomerService
{
/** URL for QA WSDL */
const CBQA12 = 'http://pegasus.doit.wisc.edu:8018/webservices/SOAProvider/plsql/doit_soa_external_customer_v2/?wsdl';
/** URL for DV WSDL */
const CBDV12 = 'http://pegasus.doit.wisc.edu:8016/webservices/SOAProvider/plsql/doit_soa_external_customer_v2/?wsdl';
/** @var DOIT_SOA_EXTERNAL_CUSTOMER_V2_Service */
private $soapClient;
/**
* {@inheritdoc}
*/
public function __construct($username, $password, $wsdlPath = null, \SoapClient $externalCustomerSoapClient = null)
{
if ($externalCustomerSoapClient !== null) {
$this->soapClient = $externalCustomerSoapClient;
return;
} else if ($wsdlPath !== null) {
$this->soapClient = new DOIT_SOA_EXTERNAL_CUSTOMER_V2_Service(
[],
$wsdlPath
);
$this->soapClient->__setSoapHeaders(WssSoapHeaderBuilder::buildUsernameToken($username, $password));
} else {
$this->soapClient = new DOIT_SOA_EXTERNAL_CUSTOMER_V2_Service(
[],
__DIR__ . '/../../../../../resources/doit_soa_external_customer_v2.xml'
);
$this->soapClient->__setSoapHeaders(WssSoapHeaderBuilder::buildUsernameToken($username, $password));
}
}
/**
* {@inheritdoc}
*/
public function createCustomer(ExternalCustomer $customer)
{
$outputParameters = $this->soapClient->CREATE_CUSTOMER(
ExternalCustomerInputParametersMapper::toInputParameters($customer)
);
return new ExternalCustomerServiceResponse(
strcasecmp($outputParameters->getP_STATUS(), 'SUCCESS') === 0,
$outputParameters->getP_RESULT_MESSAGE(),
$outputParameters->getP_CUSTOMER_NUMBER()
);
}
}
\ No newline at end of file
<?php
namespace edu\wisc\services\cbs\external_customer\generated;
class DOIT_SOA_EXTERNAL_CUSTOMER_V2_Service extends \SoapClient
{
/**
* @var array $classmap The defined classes
*/
private static $classmap = array (
'InputParameters' => 'edu\\wisc\\services\\cbs\\external_customer\\generated\\InputParameters',
'OutputParameters' => 'edu\\wisc\\services\\cbs\\external_customer\\generated\\OutputParameters',
'SOAHeader' => 'edu\\wisc\\services\\cbs\\external_customer\\generated\\SOAHeader',
);
/**
* @param array $options A array of config values
* @param string $wsdl The wsdl file to use
*/
public function __construct(array $options = array(), $wsdl = null)
{
foreach (self::$classmap as $key => $value) {
if (!isset($options['classmap'][$key])) {
$options['classmap'][$key] = $value;
}
}
$options = array_merge(array (
'features' => 1,
), $options);
if (!$wsdl) {
$wsdl = 'src/main/resources/doit_soa_external_customer_v2.xml';
}
parent::__construct($wsdl, $options);
}
/**
* @param InputParameters $body
* @return OutputParameters
*/
public function CREATE_CUSTOMER(InputParameters $body)
{
return $this->__soapCall('CREATE_CUSTOMER', array($body));
}
}
<?php
namespace edu\wisc\services\cbs\external_customer\generated;
class InputParameters
{
/**
* @var string $P_CUSTOMER_TYPE
*/
protected $P_CUSTOMER_TYPE = null;
/**
* @var string $P_CUSTOMER_IDENTIFIER
*/
protected $P_CUSTOMER_IDENTIFIER = null;
/**
* @var string $P_FIRST_NAME
*/
protected $P_FIRST_NAME = null;
/**
* @var string $P_LAST_NAME
*/
protected $P_LAST_NAME = null;
/**
* @var string $P_EMAIL
*/
protected $P_EMAIL = null;
/**
* @var string $P_PHONE
*/
protected $P_PHONE = null;
/**
* @var string $P_REFERENCE
*/
protected $P_REFERENCE = null;
/**
* @var string $P_TEST_MODE
*/
protected $P_TEST_MODE = null;
/**
* @param string $P_CUSTOMER_TYPE
* @param string $P_CUSTOMER_IDENTIFIER
* @param string $P_FIRST_NAME
* @param string $P_LAST_NAME
* @param string $P_EMAIL
* @param string $P_PHONE
* @param string $P_REFERENCE
* @param string $P_TEST_MODE
*/
public function __construct($P_CUSTOMER_TYPE, $P_CUSTOMER_IDENTIFIER, $P_FIRST_NAME, $P_LAST_NAME, $P_EMAIL, $P_PHONE, $P_REFERENCE, $P_TEST_MODE)
{
$this->P_CUSTOMER_TYPE = $P_CUSTOMER_TYPE;
$this->P_CUSTOMER_IDENTIFIER = $P_CUSTOMER_IDENTIFIER;
$this->P_FIRST_NAME = $P_FIRST_NAME;
$this->P_LAST_NAME = $P_LAST_NAME;
$this->P_EMAIL = $P_EMAIL;
$this->P_PHONE = $P_PHONE;
$this->P_REFERENCE = $P_REFERENCE;
$this->P_TEST_MODE = $P_TEST_MODE;
}
/**
* @return string
*/
public function getP_CUSTOMER_TYPE()
{
return $this->P_CUSTOMER_TYPE;
}
/**
* @param string $P_CUSTOMER_TYPE
* @return \edu\wisc\services\cbs\external_customer\generated\InputParameters
*/
public function setP_CUSTOMER_TYPE($P_CUSTOMER_TYPE)
{
$this->P_CUSTOMER_TYPE = $P_CUSTOMER_TYPE;
return $this;
}
/**
* @return string
*/
public function getP_CUSTOMER_IDENTIFIER()
{
return $this->P_CUSTOMER_IDENTIFIER;
}
/**
* @param string $P_CUSTOMER_IDENTIFIER
* @return \edu\wisc\services\cbs\external_customer\generated\InputParameters
*/
public function setP_CUSTOMER_IDENTIFIER($P_CUSTOMER_IDENTIFIER)
{
$this->P_CUSTOMER_IDENTIFIER = $P_CUSTOMER_IDENTIFIER;
return $this;
}
/**
* @return string
*/
public function getP_FIRST_NAME()
{
return $this->P_FIRST_NAME;
}
/**
* @param string $P_FIRST_NAME
* @return \edu\wisc\services\cbs\external_customer\generated\InputParameters
*/
public function setP_FIRST_NAME($P_FIRST_NAME)
{
$this->P_FIRST_NAME = $P_FIRST_NAME;
return $this;
}
/**
* @return string
*/
public function getP_LAST_NAME()
{
return $this->P_LAST_NAME;
}
/**
* @param string $P_LAST_NAME
* @return \edu\wisc\services\cbs\external_customer\generated\InputParameters
*/
public function setP_LAST_NAME($P_LAST_NAME)
{
$this->P_LAST_NAME = $P_LAST_NAME;
return $this;
}
/**
* @return string
*/
public function getP_EMAIL()
{
return $this->P_EMAIL;
}
/**
* @param string $P_EMAIL
* @return \edu\wisc\services\cbs\external_customer\generated\InputParameters
*/
public function setP_EMAIL($P_EMAIL)
{
$this->P_EMAIL = $P_EMAIL;
return $this;
}
/**
* @return string
*/
public function getP_PHONE()
{
return $this->P_PHONE;
}
/**
* @param string $P_PHONE
* @return \edu\wisc\services\cbs\external_customer\generated\InputParameters
*/
public function setP_PHONE($P_PHONE)
{
$this->P_PHONE = $P_PHONE;
return $this;
}
/**
* @return string
*/
public function getP_REFERENCE()
{
return $this->P_REFERENCE;
}
/**
* @param string $P_REFERENCE
* @return \edu\wisc\services\cbs\external_customer\generated\InputParameters
*/
public function setP_REFERENCE($P_REFERENCE)
{
$this->P_REFERENCE = $P_REFERENCE;
return $this;
}
/**
* @return string
*/
public function getP_TEST_MODE()
{
return $this->P_TEST_MODE;
}
/**
* @param string $P_TEST_MODE
* @return \edu\wisc\services\cbs\external_customer\generated\InputParameters
*/
public function setP_TEST_MODE($P_TEST_MODE)
{
$this->P_TEST_MODE = $P_TEST_MODE;
return $this;
}
}
<?php
namespace edu\wisc\services\cbs\external_customer\generated;
class OutputParameters
{
/**
* @var string $P_CUSTOMER_NUMBER
*/
protected $P_CUSTOMER_NUMBER = null;
/**
* @var string $P_STATUS
*/
protected $P_STATUS = null;
/**
* @var string $P_RESULT_MESSAGE
*/
protected $P_RESULT_MESSAGE = null;
/**
* @param string $P_CUSTOMER_NUMBER
* @param string $P_STATUS
* @param string $P_RESULT_MESSAGE
*/
public function __construct($P_CUSTOMER_NUMBER, $P_STATUS, $P_RESULT_MESSAGE)
{
$this->P_CUSTOMER_NUMBER = $P_CUSTOMER_NUMBER;
$this->P_STATUS = $P_STATUS;
$this->P_RESULT_MESSAGE = $P_RESULT_MESSAGE;
}
/**
* @return string
*/
public function getP_CUSTOMER_NUMBER()
{
return $this->P_CUSTOMER_NUMBER;
}
/**
* @param string $P_CUSTOMER_NUMBER
* @return \edu\wisc\services\cbs\external_customer\generated\OutputParameters
*/
public function setP_CUSTOMER_NUMBER($P_CUSTOMER_NUMBER)
{
$this->P_CUSTOMER_NUMBER = $P_CUSTOMER_NUMBER;
return $this;
}
/**
* @return string
*/
public function getP_STATUS()
{
return $this->P_STATUS;
}
/**
* @param string $P_STATUS
* @return \edu\wisc\services\cbs\external_customer\generated\OutputParameters
*/
public function setP_STATUS($P_STATUS)
{
$this->P_STATUS = $P_STATUS;
return $this;
}
/**
* @return string
*/
public function getP_RESULT_MESSAGE()
{
return $this->P_RESULT_MESSAGE;
}
/**
* @param string $P_RESULT_MESSAGE
* @return \edu\wisc\services\cbs\external_customer\generated\OutputParameters
*/
public function setP_RESULT_MESSAGE($P_RESULT_MESSAGE)
{
$this->P_RESULT_MESSAGE = $P_RESULT_MESSAGE;
return $this;
}
}
<?php
namespace edu\wisc\services\cbs\external_customer\generated;
class SOAHeader
{
/**
* @var string $Responsibility
*/
protected $Responsibility = null;
/**
* @var string $RespApplication
*/
protected $RespApplication = null;
/**
* @var string $SecurityGroup
*/
protected $SecurityGroup = null;
/**
* @var string $NLSLanguage
*/
protected $NLSLanguage = null;
/**
* @var string $Org_Id
*/
protected $Org_Id = null;
/**
* @param string $Responsibility
* @param string $RespApplication
* @param string $SecurityGroup
* @param string $NLSLanguage
* @param string $Org_Id
*/
public function __construct($Responsibility, $RespApplication, $SecurityGroup, $NLSLanguage, $Org_Id)
{
$this->Responsibility = $Responsibility;
$this->RespApplication = $RespApplication;
$this->SecurityGroup = $SecurityGroup;
$this->NLSLanguage = $NLSLanguage;
$this->Org_Id = $Org_Id;
}
/**
* @return string
*/
public function getResponsibility()
{
return $this->Responsibility;
}
/**
* @param string $Responsibility
* @return \edu\wisc\services\cbs\external_customer\generated\SOAHeader
*/
public function setResponsibility($Responsibility)
{
$this->Responsibility = $Responsibility;
return $this;
}
/**
* @return string
*/
public function getRespApplication()
{
return $this->RespApplication;
}
/**
* @param string $RespApplication
* @return \edu\wisc\services\cbs\external_customer\generated\SOAHeader
*/
public function setRespApplication($RespApplication)
{
$this->RespApplication = $RespApplication;
return $this;
}
/**
* @return string
*/
public function getSecurityGroup()
{
return $this->SecurityGroup;
}
/**
* @param string $SecurityGroup
* @return \edu\wisc\services\cbs\external_customer\generated\SOAHeader
*/
public function setSecurityGroup($SecurityGroup)
{
$this->SecurityGroup = $SecurityGroup;
return $this;
}
/**
* @return string
*/
public function getNLSLanguage()
{
return $this->NLSLanguage;
}
/**
* @param string $NLSLanguage
* @return \edu\wisc\services\cbs\external_customer\generated\SOAHeader
*/
public function setNLSLanguage($NLSLanguage)
{
$this->NLSLanguage = $NLSLanguage;
return $this;
}
/**
* @return string
*/
public function getOrg_Id()
{
return $this->Org_Id;
}
/**
* @param string $Org_Id
* @return \edu\wisc\services\cbs\external_customer\generated\SOAHeader
*/
public function setOrg_Id($Org_Id)
{
$this->Org_Id = $Org_Id;
return $this;
}
}
<?php
function autoload_d7fc76be4a5fe70046e6a183474348b6($class)
{
$classes = array(
'edu\wisc\services\cbs\external_customer\generated\DOIT_SOA_EXTERNAL_CUSTOMER_V2_Service' => __DIR__ .'/DOIT_SOA_EXTERNAL_CUSTOMER_V2_Service.php',
'edu\wisc\services\cbs\external_customer\generated\InputParameters' => __DIR__ .'/InputParameters.php',
'edu\wisc\services\cbs\external_customer\generated\OutputParameters' => __DIR__ .'/OutputParameters.php',
'edu\wisc\services\cbs\external_customer\generated\SOAHeader' => __DIR__ .'/SOAHeader.php'
);
if (!empty($classes[$class])) {
include $classes[$class];
};
}
spl_autoload_register('autoload_d7fc76be4a5fe70046e6a183474348b6');
// Do nothing. The rest is just leftovers from the code generation.
{
}
<?xml version = '1.0' encoding = 'UTF-8'?><definitions name="DOIT_SOA_EXTERNAL_CUSTOMER_V2" targetNamespace="http://xmlns.oracle.com/apps/ont/soaprovider/plsql/doit_soa_external_customer_v2/" xmlns:tns="http://xmlns.oracle.com/apps/ont/soaprovider/plsql/doit_soa_external_customer_v2/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns1="http://xmlns.oracle.com/apps/ont/soaprovider/plsql/doit_soa_external_customer_v2/create_customer/"> <types> <schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://xmlns.oracle.com/apps/ont/soaprovider/plsql/doit_soa_external_customer_v2/create_customer/"> <include schemaLocation="http://pegasus.doit.wisc.edu:8018/webservices/SOAProvider/plsql/doit_soa_external_customer_v2/APPS_DOIT_SOA_EXTERNAL_CUSTOMER_V2_CREATE_CUSTOMER.xsd"/> </schema> <schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://xmlns.oracle.com/apps/ont/soaprovider/plsql/doit_soa_external_customer_v2/"> <element name="SOAHeader"> <complexType> <sequence> <element name="Responsibility" minOccurs="0" type="string"/> <element name="RespApplication" minOccurs="0" type="string"/> <element name="SecurityGroup" minOccurs="0" type="string"/> <element name="NLSLanguage" minOccurs="0" type="string"/> <element name="Org_Id" minOccurs="0" type="string"/> </sequence> </complexType> </element> </schema> </types> <message name="CREATE_CUSTOMER_Input_Msg"> <part name="header" element="tns:SOAHeader"/> <part name="body" element="tns1:InputParameters"/> </message> <message name="CREATE_CUSTOMER_Output_Msg"> <part name="body" element="tns1:OutputParameters"/> </message> <portType name="DOIT_SOA_EXTERNAL_CUSTOMER_V2_PortType"> <operation name="CREATE_CUSTOMER"> <input message="tns:CREATE_CUSTOMER_Input_Msg"/> <output message="tns:CREATE_CUSTOMER_Output_Msg"/> </operation> </portType> <binding name="DOIT_SOA_EXTERNAL_CUSTOMER_V2_Binding" type="tns:DOIT_SOA_EXTERNAL_CUSTOMER_V2_PortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="CREATE_CUSTOMER"> <soap:operation soapAction="http://pegasus.doit.wisc.edu:8018/webservices/SOAProvider/plsql/doit_soa_external_customer_v2/"/> <input> <soap:header message="tns:CREATE_CUSTOMER_Input_Msg" part="header" use="literal"/> <soap:body parts="body" use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding> <service name="DOIT_SOA_EXTERNAL_CUSTOMER_V2_Service"> <port name="DOIT_SOA_EXTERNAL_CUSTOMER_V2_Port" binding="tns:DOIT_SOA_EXTERNAL_CUSTOMER_V2_Binding"> <soap:address location="http://pegasus.doit.wisc.edu:8018/webservices/SOAProvider/plsql/doit_soa_external_customer_v2/"/> </port> </service></definitions>
\ No newline at end of file
<?php
use edu\wisc\services\cbs\external_customer\ExternalCustomer;
use edu\wisc\services\cbs\external_customer\ExternalCustomerServiceResponse;
use edu\wisc\services\cbs\external_customer\MockExternalCustomerService;
/**
* Tests for {@link MockExternalCustomerService}
*/
class MockExternalCustomerServiceTest extends PHPUnit_Framework_TestCase
{
/** @test */
public function alwaysSucceedsByDefault()
{
$client = new MockExternalCustomerService();
$customer = new ExternalCustomer();
$response = $client->createCustomer($customer);
static::assertTrue($response->isSuccess());
}
/** @test */
public function returnsCustomResponse()
{
$mockResponse = new ExternalCustomerServiceResponse(
true,
"Custom External Customer Service Response",
'123456789'
);
$client = new MockExternalCustomerService($mockResponse);
$customer = new ExternalCustomer();
$response = $client->createCustomer($customer);
static::assertEquals($mockResponse, $response);
}
}
\ No newline at end of file
<?php
use edu\wisc\services\cbs\IntegrationTestCase;
use edu\wisc\services\cbs\external_customer\SoapExternalCustomerService;
class SoapExternalCustomerIT extends IntegrationTestCase
{
/**
* @test
*/
public function createsClientWithOnlyUsernameAndPassword()
{
$soapExternalCustomerService = new SoapExternalCustomerService(
static::$itData['cbs.username'],
static::$itData['cbs.password']
);
static::assertNotNull($soapExternalCustomerService);
}
/**
* @test
*/
public function createsClientWithWsdl()
{
$soapExternalCustomerService = new SoapExternalCustomerService(
static::$itData['cbs.username'],
static::$itData['cbs.password'],
SoapExternalCustomerService::CBQA12
);
static::assertNotNull($soapExternalCustomerService);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment