Skip to content

Commit

Permalink
prod script passing
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbruce committed Nov 9, 2021
1 parent 3121619 commit 812fc14
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ parameters:
- site-dynamic-php
ignoreErrors:
- '#Call to an undefined static method Eightfold\\HTMLBuilder\\Element::(.*)#'
- '#Call to an undefined static method Eightfold\\XMLBuilder\\Element::(.*)#'
- '#Call to an undefined static method Eightfold\\XMLBuilder\\Document::(.*)#'
6 changes: 5 additions & 1 deletion src/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ public function mimetype(): string

public function canonicalUrl(): string
{
return str_replace($this->contentFileName, '', 'https://joshbruce.com' . $this->path(false));
return str_replace(
$this->contentFileName,
'',
'https://joshbruce.com' . $this->path(false)
);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/HttpResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function body(): string
if (
$this->statusCode() === 200 and
$localFile->isNotMarkdown() and
$this->request->isNotSitemap($localFile)
$this->request->isNotSitemap()
) {
return $localFile->path();

Expand Down
6 changes: 5 additions & 1 deletion tests/SitemapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,9 @@

expect(
$xml->body()
)->toBe('');
)->toBe(<<<xml
<?xml version = "1.0" encoding = "UTF-8" standalone = "yes" ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>https://joshbruce.com</loc></url><url><loc>https://joshbruce.com/design-your-life</loc></url><url><loc>https://joshbruce.com/design-your-life/motivators</loc></url><url><loc>https://joshbruce.com/finances/budgeting</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20210301</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20210315</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20210401</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20210415</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20210501</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20210515</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20210601</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20210615</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20210701</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20210715</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20210801</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20210815</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20210901</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20210915</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20211001</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20211015</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck/20211101</loc></url><url><loc>https://joshbruce.com/finances/building-wealth-paycheck-to-paycheck</loc></url><url><loc>https://joshbruce.com/finances</loc></url><url><loc>https://joshbruce.com/finances/investment-policy</loc></url><url><loc>https://joshbruce.com/health-and-wellness</loc></url><url><loc>https://joshbruce.com/legal</loc></url><url><loc>https://joshbruce.com/software-development</loc></url><url><loc>https://joshbruce.com/software-development/why-dont-you-use</loc></url><url><loc>https://joshbruce.com/web-development/2021-site-in-depth</loc></url><url><loc>https://joshbruce.com/web-development</loc></url><url><loc>https://joshbruce.com/web-development/modern-web-development</loc></url><url><loc>https://joshbruce.com/web-development/my-history-on-the-web</loc></url><url><loc>https://joshbruce.com/web-development/on-constraints</loc></url><url><loc>https://joshbruce.com/web-development/on-constraints/internet-bandwidth</loc></url><url><loc>https://joshbruce.com/web-development/refactoring-re-engineering-and-rebuilding</loc></url><url><loc>https://joshbruce.com/web-development/site-stats</loc></url><url><loc>https://joshbruce.com/web-development/static-dynamic-and-interactive</loc></url></urlset>
xml
);
})->group('sitemap', 'focus');

0 comments on commit 812fc14

Please sign in to comment.