Пример #1
0
 /**
  * Render a structure of type 'list
  *
  * @param array     $list
  * @param Structure $structure
  *
  * @return string
  */
 private static function buildList(array $list, Structure $structure)
 {
     $insertTab = $structure->getTab() ? true : false;
     $result = '';
     foreach ($list as $value) {
         $result .= ($insertTab ? $structure->getTab() : '') . $structure->getIteratorCharacter() . ' ' . $value . PHP_EOL;
     }
     return $result;
 }
Пример #2
0
 public function testGetters()
 {
     $borderMock = new Mock\Matks\Vivian\Border\Border('underline');
     $structure = new BaseStructure\Structure('array', 'a', 'b', 'c', $borderMock);
     $this->string($structure->getType())->isEqualTo('array')->string($structure->getIteratorCharacter())->isEqualTo('a')->string($structure->getTab())->isEqualTo('b')->string($structure->getKeyToValueCharacter())->isEqualTo('c')->object($structure->getBorder())->isEqualTo($borderMock);
 }