diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..5cb98ab --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,53 @@ +name: PHP tests + +on: + pull_request: + branches: [ main ] + +jobs: + build: + + strategy: + matrix: + php: ['8.2', '8.3', '8.4'] + symfony: ['6.4', '7.3'] + + runs-on: ubuntu-latest + + name: On PHP ${{ matrix.php }} and Symfony ${{ matrix.symfony }} + steps: + # https://github.com/marketplace/actions/checkout + - name: Checkout + uses: actions/checkout@v5 + + # https://github.com/marketplace/actions/setup-php-action + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: mbstring, intl + ini-values: post_max_size=256M, max_execution_time=180 + tools: composer + + - name: Check PHP version + run: php -v + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Install Symfony ${{ matrix.symfony }} packages + run: | + composer update symfony/console:${{ matrix.symfony }} + composer update symfony/stopwatch:${{ matrix.symfony }} + + - name: Code lint PHP files + run: ./vendor/bin/phplint + + - name: Coding standards + run: ./vendor/bin/phpcs + + - name: PHPUnit + run: ./vendor/bin/phpunit diff --git a/.gitignore b/.gitignore index 00d7507..3ddd3e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ vendor -.phpunit.result.cache package-lock.json -tests/example/apollo composer.lock -var/cache/* \ No newline at end of file +var/cache/* +.phpunit.cache +.phpunit.result.cache +.phplint.cache diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist new file mode 100644 index 0000000..fdff1a3 --- /dev/null +++ b/.phpcs.xml.dist @@ -0,0 +1,31 @@ + + + + + + + src + tests + + + + + + + + + + + + + + + + + + + tests/* + + + \ No newline at end of file diff --git a/.phplint.yml b/.phplint.yml new file mode 100644 index 0000000..e1fc3c2 --- /dev/null +++ b/.phplint.yml @@ -0,0 +1,6 @@ +path: ./ +jobs: 10 +extensions: + - php +exclude: + - vendor \ No newline at end of file diff --git a/README.md b/README.md index fbda556..0eb6eee 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Key features: ## Requirements -* PHP 7.4+ +* PHP 8.2+ * [Composer](https://getcomposer.org/) ## Installation @@ -61,4 +61,4 @@ See [contributing](docs/contributing.md) for making changes to this repo. Developed by [Simon R Jones](https://github.com/simonrjones/), HTML/CSS design system layout by Nicola Saunders. -Inspired by [GOVUK Design System](https://design-system.service.gov.uk/) and [Drizzle](https://github.com/cloudfour/drizzle). \ No newline at end of file +Inspired by [GOVUK Design System](https://design-system.service.gov.uk/) and [Drizzle](https://github.com/cloudfour/drizzle). diff --git a/assets/design-system/styles.css b/assets/design-system/styles.css index 4c17ad0..cac5a28 100644 --- a/assets/design-system/styles.css +++ b/assets/design-system/styles.css @@ -39,25 +39,22 @@ #Base \*------------------------------------*/ html { - height: 100%; + block-size: 100%; } body { background-color: #fff; color: #1a1c1b; - display: -ms-grid; display: grid; - -ms-grid-columns: 100%; font-family: "Trebuchet MS", Geneva, sans-serif; font-size: 1rem; font-style: normal; font-weight: 400; grid-template-columns: 100%; - -ms-grid-rows: 1fr auto; grid-template-rows: 1fr auto; line-height: 1.5; - min-height: 100%; + min-block-size: 100%; overflow-x: hidden; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; @@ -103,16 +100,14 @@ main:focus, .visuallyhidden:not(:focus):not(:active), .skip-link:not(:focus):not(:active) { + block-size: 1px; border: 0; - clip: rect(0 0 0 0); - -webkit-clip-path: inset(100%); - clip-path: inset(100%); - height: 1px; + clip-path: inset(50%); + inline-size: 1px; overflow: hidden; padding: 0; position: absolute; white-space: nowrap; - width: 1px; } @@ -120,25 +115,25 @@ main:focus, .hidden + *, .visuallyhidden + *, .skip-link + * { - margin-top: 0 !important; + margin-block-start: 0 !important; } br { - margin-top: 0; + margin-block-start: 0; } svg { + block-size: auto; fill: currentColor; - height: auto; - width: 100%; + max-inline-size: 100%; } img { - height: auto; - width: 100%; + block-size: auto; + max-inline-size: 100%; } abbr { @@ -185,10 +180,10 @@ a:not([class]) { border: 0; color: #005A9C; cursor: pointer; - padding-left: 0.125rem; - padding-right: 0.125rem; + padding-inline: 0.125rem; text-decoration: underline; - text-decoration-skip-ink: auto; + text-decoration-skip: auto; + text-decoration-skip-ink: auto } a:not([class]):visited { @@ -228,18 +223,16 @@ ul:not([class]) li ol, ol:not([class]) > * + *, ol:not([class]) li ul, ol:not([class]) li ol { - margin-top: 0.75em; + margin-block-start: 0.75em; } ul:not([class]) { - -webkit-padding-start: 2.4em; padding-inline-start: 2.4em; } ol:not([class]) { counter-reset: count; list-style-type: none; - -webkit-padding-start: 1.25em; padding-inline-start: 1.25em; } @@ -249,7 +242,6 @@ ol:not([class]) > li { ol:not([class]) > li::before { content: counters(count, ".") " "; - -webkit-padding-end: 0.5em; padding-inline-end: 0.5em; } @@ -261,14 +253,14 @@ ol:not([class]) > li::before { .inline-list li { display: inline-block; - margin-bottom: 0.5em; - margin-right: 1.5em; - margin-top: 0; + margin-block-end: 0.5em; + margin-block-start: 0; + margin-inline-end: 1.5em; } .inline-list li:last-child { - margin-bottom: 0; - margin-right: 0; + margin-block-end: 0; + margin-inline-end: 0; } @@ -277,12 +269,12 @@ dl dt { } dl dd + dt { - margin-top: 0.5em; + margin-block-start: 0.5em; } dl dt + dd, dl dd + dd { - margin-top: 0.25em; + margin-block-start: 0.25em; } @@ -295,9 +287,9 @@ dl dd + dd { } .skip-link:active, .skip-link:focus { - left: 0; + inset-block-start: 0; + inset-inline-start: 0; position: absolute; - top: 0; z-index: 999; } @@ -310,7 +302,7 @@ dl dd + dd { table { border: 1px solid; border-collapse: collapse; - width: 100%; + inline-size: 100%; } tr:nth-child(even) { @@ -321,7 +313,6 @@ th, td, table caption { padding: 0.75rem; - text-align: left; text-align: start; } @@ -335,7 +326,8 @@ th[scope="col"] { } td { - vertical-align: text-top; } + vertical-align: text-top; +} @@ -361,28 +353,16 @@ td { .l-center { box-sizing: content-box; - margin-left: auto; - margin-right: auto; - max-width: 70rem; - padding-left: 5vw; - padding-right: 5vw; + margin-inline: auto; + max-inline-size: 70rem; + padding-inline: 5vw; } .l-cluster { - overflow: hidden; -} - -.l-cluster > * { display: flex; - flex-direction: row; - flex-wrap: wrap; - margin: calc(1rem / 2 * -1); -} - -.l-cluster > * > * { - display: inline-block; - margin: calc(1rem / 2); + flex-flow: row wrap; + gap: 1rem; } @@ -410,7 +390,7 @@ td { } .l-sidebar .sidebar > * + * { - margin-top: 1.5rem; + margin-block-start: 1.5rem; } .l-sidebar .not-sidebar { @@ -419,7 +399,7 @@ td { flex-direction: column; flex-grow: 999; justify-content: flex-start; - min-width: calc(55% - 1.7rem); + min-inline-size: calc(55% - 1.7rem); } @@ -430,7 +410,7 @@ td { } .l-stack > * + * { - margin-top: 1.5rem; + margin-block-start: 1.5rem; } @@ -439,9 +419,8 @@ td { #Global header \*------------------------------------*/ .global-header { - margin-bottom: 2rem; - padding-bottom: 1rem; - padding-top: 1rem; + margin-block-end: 2rem; + padding-block: 1rem; } .global-header__inner { @@ -457,7 +436,9 @@ td { .global-logo { align-items: center; border: 2px solid transparent; - display: inline-flex; + gap: 1rem; + display: flex; + padding-block-end: 2px; text-decoration: none; } @@ -471,14 +452,11 @@ td { .global-logo svg { display: block; - height: 3rem; - width: 4.5rem; } -.global-logo span { +.global-logo span:not(.visuallyhidden) { font-size: 1.7rem; font-weight: bold; - margin-left: 0.5em; } @@ -518,18 +496,18 @@ td { } .global-nav li.active::after { - bottom: 3px; - height: 3px; - left: 0; - width: 100%; + block-size: 3px; + inset-block-end: 3px; + inline-size: 100%; + inset-inline-start: 0; } .section-nav li.active::after { - height: 60%; - left: -3px; - top: 50%; + block-size: 60%; + inset-inline-start: -3px; + inset-block-start: 50%; transform: translateY(-50%); - width: 3px; + inline-size: 3px; } .global-nav li.active .nav-link:hover, @@ -543,7 +521,7 @@ td { #Main \*------------------------------------*/ main > * { - max-width: 43rem; + max-inline-size: 43rem; } @@ -558,14 +536,14 @@ main > * { } .swatches tr { - border-bottom: solid 0.625rem transparent; + border-block-end: solid 0.625rem transparent; display: table-row; } .swatches th { display: block; font-weight: normal; - padding-left: 3.125rem; + padding-inline-start: 3.125rem; position: relative; } @@ -579,21 +557,21 @@ main > * { } .color-swatch { + block-size: 2.5rem; border: 1px black dashed; border-radius: 4px; display: block; - height: 2.5rem; - left: 0; + inline-size: 2.5rem; + inset-block-start: 0; + inset-inline-start: 0; position: absolute; - top: 0; - width: 2.5rem; } @media screen and (min-width: 48em) { .color-swatch { display: inline-block; - margin-right: 0.625rem; + margin-inline-end: 0.625rem; position: static; vertical-align: middle; } @@ -603,7 +581,7 @@ main > * { .swatches th, .swatches td { display: block; - padding-left: 3.125rem; + padding-inline-start: 3.125rem; position: relative; } @@ -623,8 +601,8 @@ main > * { #Code snippet containers \*------------------------------------*/ .hljs.hljs { - max-height: 30rem; - max-width: 43rem; + max-block-size: 30rem; + max-inline-size: 43rem; padding: 1rem; } @@ -642,9 +620,9 @@ main > * { .showcase { border: solid 1px; display: block; - min-width: 100%; + inline-size: 1px; + min-inline-size: 100%; padding: 1rem; - width: 1px; } @@ -653,11 +631,9 @@ main > * { #Global footer \*------------------------------------*/ .global-footer { - -ms-grid-row: 2; grid-row-start: 2; grid-row-end: 3; - padding-bottom: 1rem; - padding-top: 1rem; + padding-block: 1rem; } @@ -666,7 +642,7 @@ main > * { \*------------------------------------*/ a.heading-permalink { color: #005797; - padding-right: 0.5em; + padding-inline-end: 0.5em; } a.heading-permalink:focus { diff --git a/composer.json b/composer.json index 83cabdf..a53837d 100644 --- a/composer.json +++ b/composer.json @@ -4,17 +4,18 @@ "type": "library", "license": "MIT", "require": { - "php": ">7.4.0", + "php": ">=8.2", "twig/twig": "^3.0", - "symfony/console": "^5.0", - "symfony/stopwatch": "^5.0", - "league/flysystem": "^2.2", + "symfony/console": "^6.4|^7.1", + "symfony/stopwatch": "^6.4|^7.1", + "league/flysystem": "^3.3", "masterminds/html5": "^2.7", - "league/commonmark": "^2.0", - "alchemy/zippy": "^1.0" + "league/commonmark": "^2.0" }, "require-dev": { - "phpunit/phpunit": "^8", + "overtrue/phplint": "^9.0", + "phpunit/phpunit": ">=10.0", + "roave/security-advisories": "dev-latest", "squizlabs/php_codesniffer": "^3.5" }, "autoload": { diff --git a/docs/contributing.md b/docs/contributing.md index ab2f823..7ee9a86 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -50,18 +50,24 @@ configuration via the `src/Config.php` class. You can test your changes by using the example project. -Build files: +Run Composer install in the root: +```shell +composer install ``` -cd tests/example -../../bin/design-system + +If you have errors with this delete your local `composer.lock` file and try again. + +Build files: + +```shell +bin/design-system --path=tests/example ``` Serve: ``` -cd _dist/ -php -S localhost:8000 +php -S localhost:8000 -t tests/example/_dist/ ``` Test at: http://localhost:8000 diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b0486e9..0155190 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,26 +1,18 @@ - - - - - - - - - - tests - - - - - - src - - - + + + + + + + + tests + + + + + src + + diff --git a/src/Build.php b/src/Build.php index d61a633..3eeeee1 100644 --- a/src/Build.php +++ b/src/Build.php @@ -1,9 +1,9 @@ output = $output; // Set default file permissions - $visibility = PortableVisibilityConverter::fromArray([ + $visibility = PortableVisibilityConverter::fromArray( + [ 'file' => [ 'public' => 0644, 'private' => 0600, @@ -52,8 +56,9 @@ public function __construct(Config $config, SymfonyStyle $output) 'public' => 0755, 'private' => 0700, ], - ], - Visibility::PUBLIC); + ], + Visibility::PUBLIC + ); $adapter = new LocalFilesystemAdapter($config->getRootPath(), $visibility); $this->filesystem = new Filesystem($adapter); $this->markdown = new Markdown(); @@ -110,7 +115,6 @@ public function cleanDestination(): void try { $this->filesystem->deleteDirectory($destination); $this->filesystem->createDirectory($destination); - } catch (FilesystemException | UnableToDeleteDirectory $exception) { throw new BuildException(sprintf('Cannot clean destination folder, error: %s', $exception->getMessage())); } @@ -130,13 +134,13 @@ public function buildAssets(bool $passthru = false) } // Change dir, then run command - $command = sprintf('cd %s && %s',$this->config->getRootPath(), $command); + $command = sprintf('cd %s && %s', $this->config->getRootPath(), $command); $output = ''; if ($passthru) { - passthru($command,$status); + passthru($command, $status); } else { - exec($command,$output,$status); + exec($command, $output, $status); } if ($status !== 0) { @@ -245,7 +249,7 @@ public function buildDocs() // Sort layouts in each sub-directory foreach ($pages as $subDirectory => $children) { - uasort($pages[$subDirectory], function($a, $b) { + uasort($pages[$subDirectory], function ($a, $b) { // Stick index layouts to top if ($a['filename'] === 'index') { return -1; @@ -383,7 +387,7 @@ public function buildDocsPage(string $title, string $sourcePath, string $destina /** * Create ZIP file of website assets for developer use * - * @see https://github.com/alchemy-fr/Zippy + * @see https://www.php.net/manual/en/class.ziparchive.php */ public function buildZipFile() { @@ -391,11 +395,9 @@ public function buildZipFile() $this->output->text('Skipping, no ZIP folder defined in config'); return false; } - - // Path to folder to add to ZIP archive (relative to project root) $zipFolder = $this->config->get('zip_folder'); if (empty($zipFolder)) { - $this->output->text('Skipping, no ZIP folder defined in config'); + $this->output->text('Skipping, no source folder to creat a ZIP defined in config'); return false; } $source = $this->config->getFullPath($zipFolder); @@ -413,21 +415,29 @@ public function buildZipFile() } $destination = $this->config->getFullPath($this->config->buildPath(Config::ASSETS_PATH, $zipName)) . '.zip'; - try { - $zippy = Zippy::load(); - $archive = $zippy->create($destination, [ - $zipName => $source - ], true); - - if ($this->output->isVerbose()) { - $this->output->text('* ' . $destination); - } + // Setup ZIP archive + $zip = new ZipArchive(); + if ($zip->open($destination, ZipArchive::CREATE) !== true) { + throw new BuildException(sprintf('Cannot create ZIP archive at %s', $destination)); + } - return true; + // ZIP folders + $info = pathinfo($source); + $zipFolderRegex = '/^' . preg_quote($info["dirname"] . '/' . $info["basename"], '/') . '/'; + + // Add all files in source folder to ZIP + $flags = \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::CURRENT_AS_SELF; + $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source, $flags)); + /** @var RecursiveDirectoryIterator $file */ + foreach ($files as $file) { + $filepath = $file->getPathname(); + $zipPath = preg_replace($zipFolderRegex, '', $filepath); + $zip->addFile($filepath, $zipPath); + } - } catch (\Alchemy\Zippy\Exception\ExceptionInterface $exception) { - throw new BuildException(sprintf('Cannot build ZIP archive for folder %s, destination %s, error: %s', $zipFolder, $destination, $exception->getMessage())); + if (!$zip->close()) { + throw new BuildException(sprintf('Cannot save ZIP archive at %s', $destination)); } + return true; } - } diff --git a/src/Command/BuildCommand.php b/src/Command/BuildCommand.php index 0cb7864..449aa7e 100644 --- a/src/Command/BuildCommand.php +++ b/src/Command/BuildCommand.php @@ -1,4 +1,5 @@ setDescription('Build design system website') @@ -43,16 +45,16 @@ protected function configure() 'actions', 'a', InputOption::VALUE_REQUIRED, - 'Which actions to run ("c" = clean, "a" = assets, "p" = layouts, "t" = templates)', + 'Which actions to run ("c" = clean, "a" = assets, "d" = docs, "z" = zip)', 'cadz' ) ; } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $stopwatch = new Stopwatch(); - $stopwatch->start(self::$defaultName); + $stopwatch->start($this->getName()); $io = new SymfonyStyle($input, $output); $io->title(Version::NAME . ': ' . $this->getDescription()); @@ -98,7 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } // Finish up - $event = $stopwatch->stop(self::$defaultName); + $event = $stopwatch->stop($this->getName()); $io->newLine(); $io->text(sprintf('Execution time: %01.2f secs', $event->getDuration() / 1000)); $io->text(sprintf('Memory usage: %01.2f MB', $event->getMemory() / 1024 / 1024)); @@ -125,5 +127,4 @@ private function doZip(): bool { return strpos($this->actions, 'z') !== false; } - -} \ No newline at end of file +} diff --git a/src/Command/InitCommand.php b/src/Command/InitCommand.php index b600c96..2ba5f7b 100644 --- a/src/Command/InitCommand.php +++ b/src/Command/InitCommand.php @@ -1,4 +1,5 @@ setDescription('Initialise design system project') @@ -34,7 +35,7 @@ protected function configure() ; } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); $io->title(Version::NAME . ': ' . $this->getDescription()); @@ -66,4 +67,4 @@ protected function execute(InputInterface $input, OutputInterface $output) // Finish up return self::SUCCESS; } -} \ No newline at end of file +} diff --git a/src/Command/WatchCommand.php b/src/Command/WatchCommand.php deleted file mode 100644 index 94cc0eb..0000000 --- a/src/Command/WatchCommand.php +++ /dev/null @@ -1,30 +0,0 @@ -setDescription('Build & watch project files') - ->setHelp('This command builds the project files and watches for any changes, on chance it rebuilds files') - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $io = new SymfonyStyle($input, $output); - $io->title('Apollo: Build & Watch your project files'); - - return 0; - } -} \ No newline at end of file diff --git a/src/Config.php b/src/Config.php index cb0dc96..2a5e1b7 100644 --- a/src/Config.php +++ b/src/Config.php @@ -48,7 +48,7 @@ class Config * @throws PathDoesNotExistException * @throws \League\Flysystem\FilesystemException */ - public function __construct(string $rootPath, string $configPath = null) + public function __construct(string $rootPath, ?string $configPath = null) { $this->setRootPath($rootPath); $adapter = new LocalFilesystemAdapter($rootPath); @@ -65,7 +65,7 @@ public function __construct(string $rootPath, string $configPath = null) * @param ?string $currentUrl * @return array */ - public function getNavigation(string $currentUrl = null): array + public function getNavigation(?string $currentUrl = null): array { $navigation = []; foreach ($this->get('navigation') as $label => $url) { @@ -130,7 +130,7 @@ public function loadConfig(string $configPath) } // Require config file, which must contain a $config array - require $configPath; + require $this->getFullPath($configPath); if (!isset($config) || !is_array($config)) { throw new ConfigException(sprintf('Config file %s must contain the $config variable and it must be an array', $configPath)); } @@ -263,5 +263,4 @@ public function getPageTitle(string $title): string } return $title; } - -} \ No newline at end of file +} diff --git a/src/Exception/AssetsException.php b/src/Exception/AssetsException.php index ef0e8e0..5fe7f39 100644 --- a/src/Exception/AssetsException.php +++ b/src/Exception/AssetsException.php @@ -1,9 +1,9 @@ currentHtmlMatch, $this->currentFile)); } } - -} \ No newline at end of file +} diff --git a/src/Parser/ExampleParser.php b/src/Parser/ExampleParser.php index 959f828..08d1cce 100644 --- a/src/Parser/ExampleParser.php +++ b/src/Parser/ExampleParser.php @@ -1,4 +1,5 @@ output->isVerbose()) { $this->output->text('* ' . $destination); } - } catch (FilesystemException | UnableToWriteFile $exception) { throw new ExampleTagException(sprintf('Cannot save example template to %s (%s). Error with tag %s in doc file %s', $filename, $exception->getMessage(), $this->currentHtmlMatch, $this->currentFile)); } @@ -126,5 +126,4 @@ public function render(array $params): string ]; return $this->twig->render('@DesignSystem/partials/_example.html.twig', $data); } - -} \ No newline at end of file +} diff --git a/src/Parser/Markdown.php b/src/Parser/Markdown.php index a996229..c3448ee 100644 --- a/src/Parser/Markdown.php +++ b/src/Parser/Markdown.php @@ -62,7 +62,6 @@ public function linkProcessor(DocumentParsedEvent $event) /** @var Link $node */ foreach ($matchingNodes as $node) { - // Only update if a local URL $info = parse_url($node->getUrl()); if (count($info) > 1 && isset($info['host'])) { @@ -97,5 +96,4 @@ public function render(string $content): string { return $this->getConvertor()->convert($content); } - -} \ No newline at end of file +} diff --git a/src/Parser/ParserAbstract.php b/src/Parser/ParserAbstract.php index a4310ea..e4f14a7 100644 --- a/src/Parser/ParserAbstract.php +++ b/src/Parser/ParserAbstract.php @@ -1,4 +1,5 @@ -Design System \ No newline at end of file + \ No newline at end of file diff --git a/templates/partials/_header.html.twig b/templates/partials/_header.html.twig index 20ccaf3..30847b3 100644 --- a/templates/partials/_header.html.twig +++ b/templates/partials/_header.html.twig @@ -1,17 +1,13 @@ \ No newline at end of file diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index afd86e7..21aa9b4 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -3,13 +3,11 @@ namespace Tests; use PHPUnit\Framework\TestCase; - use Studio24\Apollo\Command\BuildCommand; use Studio24\DesignSystem\Config; class ConfigTest extends TestCase { - public function testSaveDefaultConfigFile() { $testConfigPath = __DIR__ . '/temp/test.design-system-config2.php'; @@ -24,5 +22,4 @@ public function testSaveDefaultConfigFile() $this->assertTrue($resultCode === 0, $result); unlink($testConfigPath); } - -} \ No newline at end of file +} diff --git a/tests/MarkdownTest.php b/tests/MarkdownTest.php index 0b77c69..be5040d 100644 --- a/tests/MarkdownTest.php +++ b/tests/MarkdownTest.php @@ -7,7 +7,6 @@ class MarkdownTest extends TestCase { - public function testMarkdown() { $markdown = new Markdown(); @@ -36,5 +35,4 @@ public function testMarkdown() $this->assertStringNotContainsString('

Hello testing

', $html, 'Auto-link headings'); $this->assertStringContainsString('

Sub-heading

', $html, 'Auto-link headings'); } - } diff --git a/tests/ParseSpecialFunctionsTest.php b/tests/ParseSpecialFunctionsTest.php index 2abd650..dd6919d 100644 --- a/tests/ParseSpecialFunctionsTest.php +++ b/tests/ParseSpecialFunctionsTest.php @@ -8,7 +8,6 @@ final class ParseSpecialFunctionsTest extends TestCase { - public function testMatchAll() { $parser = new TagParser(); @@ -46,6 +45,4 @@ public function testInvalidHtmlTag() $this->expectException(HtmlParserException::class); $matches = $parser->matchAll('

some text

', 'example'); } - - -} \ No newline at end of file +} diff --git a/tests/example/design-system-config.php b/tests/example/design-system-config.php index 98e89c6..ad310fa 100644 --- a/tests/example/design-system-config.php +++ b/tests/example/design-system-config.php @@ -6,6 +6,7 @@ * Overrides default config settings * @see Studio24\DesignSystem\Config::$config */ + $config = [ 'site_title' => 'Studio 24 Design System', 'navigation' => [ @@ -14,6 +15,5 @@ 'Guidelines' => '/guidelines/', 'Templates' => '/templates/', ], - 'zip_folder' => 'apollo/assets' + 'zip_folder' => '_dist/assets/design-system' ]; -