示例#1
0
 /**
  * @test
  */
 public function hasCountryWithCountryReturnsTrue()
 {
     /** @var tx_oelib_Mapper_Country $mapper */
     $mapper = tx_oelib_MapperRegistry::get('tx_oelib_Mapper_Country');
     /** @var tx_oelib_Model_Country $country */
     $country = $mapper->find(54);
     $this->fixture->setCountry($country);
     self::assertTrue($this->fixture->hasCountry());
 }
 /**
  * Formats a place for the thank-you e-mail.
  *
  * @param tx_seminars_Model_Place $place the place to format
  * @param string $newline the newline to use in formatting, must be either LF or '<br />'
  *
  * @return string the formatted place, will not be empty
  */
 private function formatPlace(tx_seminars_Model_Place $place, $newline)
 {
     $address = preg_replace('/[\\n|\\r]+/', ' ', str_replace('<br />', ' ', strip_tags($place->getAddress())));
     $countryName = $place->hasCountry() ? ', ' . $place->getCountry()->getLocalShortName() : '';
     $zipAndCity = trim($place->getZip() . ' ' . $place->getCity());
     return $place->getTitle() . $newline . $address . $newline . $zipAndCity . $countryName;
 }