public function testGetPriorities() { $collection = new PlaceholderCollection(); $collection->add(new TOC()); $this->assertSame([Placeholder::PRIORITY_LAST], $collection->getPriorities()); $collection->add(new Frontmatter()); $this->assertSame([Placeholder::PRIORITY_FIRST, Placeholder::PRIORITY_LAST], $collection->getPriorities(), 'Priorities must be sorted low to high'); }
public function __construct(array $globals = null) { $this->version = new VersionInfo('writeme', '0.1.0', '<<green>>%s<<reset>> <<yellow>>%s<<reset>>'); $clif = new CliFactory(); if ($globals === null) { $globals = $GLOBALS; } $this->context = $clif->newContext($globals); $this->stdio = Stdio::create(); $this->placeholders = new PlaceholderCollection([new Frontmatter(), new TOC(), new API(), new Changelog(), new Badge()]); $placeholderDocs = new PlaceholderDocs(); $placeholderDocs->setPlaceholderCollection($this->placeholders); $this->placeholders->add($placeholderDocs); $this->converter = new Converter(); }