Exemplo n.º 1
0
 public function __construct(Contact $model = null, $attributeName = null)
 {
     assert('$model != null');
     assert('$attributeName != null && is_string($attributeName)');
     parent::__construct($model, $attributeName);
     $this->contactStatesData = ContactsUtil::getContactStateDataKeyedByOrder();
     $this->contactStatesLabels = ContactsUtil::getContactStateLabelsKeyedByLanguageAndOrder();
     $startingState = ContactsUtil::getStartingState();
     $this->startingStateOrder = $startingState->order;
 }
Exemplo n.º 2
0
 /**
  * @depends testGetContactStateDataFromStartingStateOnAndKeyedById
  */
 public function testGetContactStateLabelsKeyedByLanguageAndOrder()
 {
     $data = ContactsUtil::getContactStateLabelsKeyedByLanguageAndOrder();
     $compareData = null;
     $this->assertEquals($compareData, $data);
     $states = ContactState::getByName('Qualified');
     $states[0]->serializedLabels = serialize(array('fr' => 'QualifiedFr', 'de' => 'QualifiedDe'));
     $this->assertTrue($states[0]->save());
     $data = ContactsUtil::getContactStateLabelsKeyedByLanguageAndOrder();
     $compareData = array('fr' => array($states[0]->order => 'QualifiedFr'), 'de' => array($states[0]->order => 'QualifiedDe'));
     $this->assertEquals($compareData, $data);
 }