Beispiel #1
0
 /**
  * Render bordered string
  *
  * @param string $string
  * @param Border $border
  *
  * @return string
  * @throws Exception
  */
 public static function buildBorder($string, Border $border)
 {
     switch ($border->getType()) {
         case Border::TYPE_UNDERLINE:
             $result = self::buildUnderline($string, $border);
             break;
         case Border::TYPE_FRAME:
             $result = self::buildFrame($string, $border);
             break;
         default:
             throw new Exception('Unknown border type ' . $border->getType());
     }
     return $result;
 }
Beispiel #2
0
 public function testGetters()
 {
     $border = new BaseBorder\Border('frame', 'a', 'b', 'c');
     $this->string($border->getType())->isEqualTo('frame')->string($border->getLineCharacter())->isEqualTo('a')->string($border->getColumnCharacter())->isEqualTo('b')->string($border->getCrossCharacter())->isEqualTo('c');
 }