/** * testGet * * @since 2.1.0 * * @param array $path * @param mixed $exclude * @param array $expect * * @dataProvider providerGet */ public function testGet($path = null, $exclude = null, $expect = array()) { /* setup */ $directory = new Directory(Stream::url($path), $exclude); /* result */ $result = $directory->get(); /* compare */ $this->assertEquals($expect, $result); }
/** * centerStart * * @since 2.2.0 */ public static function centerStart() { if (Registry::get('firstParameter') === 'preview') { $partialsPath = 'modules/preview/partials/'; $partialsDirectory = new Directory($partialsPath); $partialsDirectoryArray = $partialsDirectory->get(); /* collect partial output */ $output = '<div class="preview clearfix">' . PHP_EOL; /* include as needed */ if (Registry::get('secondParameter')) { $output .= self::_render(Registry::get('secondParameter'), $partialsPath . Registry::get('secondParameter') . '.phtml'); } else { foreach ($partialsDirectoryArray as $partial) { $output .= self::_render(str_replace('.phtml', '', $partial), $partialsPath . $partial); } } $output .= '</div>' . PHP_EOL; echo $output; } }