Ejemplo n.º 1
0
 /**
  * Test validation in the setters
  */
 public function testFaultyProperties()
 {
     $customer = new Customer();
     try {
         $customer->setPreferredLanguage(str_repeat('a', 10));
     } catch (\Exception $e) {
         $this->assertInstanceOf('TijsVerkoyen\\Bpost\\Exception', $e);
         $this->assertEquals('Invalid value, possible values are: ' . implode(', ', Customer::getPossiblePreferredLanguageValues()) . '.', $e->getMessage());
     }
     try {
         $customer->setTitle(str_repeat('a', 10));
     } catch (\Exception $e) {
         $this->assertInstanceOf('TijsVerkoyen\\Bpost\\Exception', $e);
         $this->assertEquals('Invalid value, possible values are: ' . implode(', ', Customer::getPossibleTitleValues()) . '.', $e->getMessage());
     }
 }