Example #1
0
 /**
  * (non-PHPdoc)
  * @see PHPUnit_Framework_TestCase::setUp()
  */
 public function setUp()
 {
     parent::setUp();
     $expAddress = new Address();
     $expAddress->setLine2('Address Line 2');
     $expAddress->setPostalCode('34000');
     $expAddress->setCity('City');
     $destAddress = new AddressDest();
     $destAddress->setName('Name');
     $destAddress->setSurname('Surname');
     $destAddress->setEmail('*****@*****.**');
     $destAddress->setLine2('Address Line 2');
     $destAddress->setPostalCode('34000');
     $destAddress->setCity('City');
     $this->context = new ServiceCallContext('ACME');
     $this->parcel = new Parcel(0.72);
     $this->expEnv = new ExpEnv($expAddress);
     $this->destEnv = new DestEnv($destAddress);
     $this->letter = new Letter();
     $this->letter->setContractNumber('111111');
     $this->letter->setPassword('password');
     $this->letter->setService($this->context);
     $this->letter->setParcel($this->parcel);
     $this->letter->setExp($this->expEnv);
     $this->letter->setDest($this->destEnv);
     $this->letter->setProfil(null);
 }
Example #2
0
 /**
  * Test a valid minimal object
  *
  * @depends testEmptyObject
  */
 public function testMinimalObject(Address $address)
 {
     $address->setLine2('Address Line 2');
     $address->setPostalCode('34000');
     $address->setCity('City');
     $this->validateObject($address, array());
     return $address;
 }
Example #3
0
use WSColissimo\WSColiPosteLetterService\Request\ValueObject\DestEnv;
use WSColissimo\WSColiPosteLetterService\Request\ValueObject\ExpEnv;
use WSColissimo\WSColiPosteLetterService\Request\ValueObject\Address;
use WSColissimo\WSColiPosteLetterService\Request\ValueObject\AddressDest;
use WSColissimo\WSColiPosteLetterService\Request\ValueObject\Parcel;
use WSColissimo\WSColiPosteLetterService\Request\ValueObject\ServiceCallContext;
use WSColissimo\WSColiPosteLetterService\Request\ValueObject\Letter;
use WSColissimo\WSColiPosteLetterService\Request\LetterColissimoRequest;
use WSColissimo\WSColiPosteLetterService\Util\ServiceAvailability;
use Symfony\Component\Validator\Validation;
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/parameters.php';
// build the sender address
$expAddress = new Address();
$expAddress->setCompanyName('Acme and Co');
$expAddress->setLine2('Place de la Comedie');
$expAddress->setPostalCode('34000');
$expAddress->setCity('Montpellier');
// build the recipient address
$destAddress = new AddressDest();
$destAddress->setCivility('M');
$destAddress->setName('Prenom');
$destAddress->setSurname('Nom');
$destAddress->setLine2('Place de la Comedie');
$destAddress->setPostalCode('34000');
$destAddress->setCity('Montpellier');
$destAddress->setPhone('0606060606');
$destAddress->setEmail('*****@*****.**');
// build the main letter object
$letter = new Letter();
$letter->setContractNumber($parameters['account']);