Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal build service refactor tie in #65

Merged
merged 15 commits into from
Apr 8, 2022
6 changes: 3 additions & 3 deletions tests/Feature/Commands/BuildStaticSiteCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ public function test_build_command_contains_expected_output()
->expectsOutput('Creating Blade Pages...')
->expectsOutputToContain('All done! Finished in')
->expectsOutput('Congratulations! 🎉 Your static site has been built!')
->expectsOutput('Your new homepage is stored here -> file://' . str_replace(
->expectsOutput('Your new homepage is stored here -> file://'.str_replace(
'\\',
'/',
realpath(Hyde::path('_site'))
) . '/index.html')
).'/index.html')
->assertExitCode(0);
}

Expand Down Expand Up @@ -155,7 +155,7 @@ private function checkIfDirectoryIsEmpty(string $directory): bool
{
$scan = scandir(Hyde::path($directory), SCANDIR_SORT_NONE);
if ($scan) {
return !isset($scan[2]);
return ! isset($scan[2]);
}

return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function test_handle_is_successful_with_valid_path()
{
copy(Hyde::path(static::$stub), Hyde::path(static::$path));

$this->artisan('rebuild ' . static::$path)
$this->artisan('rebuild '.static::$path)
->assertExitCode(0);

$outputPath = '_site/test-07239181-403e-443b-94f3-f912a031f31a.html';
Expand Down
8 changes: 4 additions & 4 deletions tests/Feature/Services/CollectionServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Tests\Feature\Services;

use Tests\TestCase;
use App\Commands\TestWithBackup;
use Hyde\Framework\Hyde;
use Hyde\Framework\Services\CollectionService;
use Hyde\Framework\Models\BladePage;
use Hyde\Framework\Models\DocumentationPage;
use Hyde\Framework\Models\MarkdownPage;
use Hyde\Framework\Models\MarkdownPost;
use Hyde\Framework\Models\DocumentationPage;
use Hyde\Framework\Services\CollectionService;
use Illuminate\Support\Facades\File;
use App\Commands\TestWithBackup;
use Tests\TestCase;

class CollectionServiceTest extends TestCase
{
Expand Down
22 changes: 11 additions & 11 deletions tests/Setup/MockContentSourceFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
namespace Tests\Setup;

use Hyde\Framework\Hyde;
use Hyde\Framework\Models\MarkdownPost;
use Hyde\Framework\Models\MarkdownPage;
use Hyde\Framework\Models\DocumentationPage;
use Hyde\Framework\Models\BladePage;
use Hyde\Framework\Models\DocumentationPage;
use Hyde\Framework\Models\MarkdownPage;
use Hyde\Framework\Models\MarkdownPost;
use Hyde\Framework\Services\BuildService;

trait MockContentSourceFiles
{
public function createContentSourceTestFiles()
{
touch(Hyde::path(BuildService::getFilePathForModelClassFiles(MarkdownPost::class) . '/test.md'));
touch(Hyde::path(BuildService::getFilePathForModelClassFiles(MarkdownPage::class) . '/test.md'));
touch(Hyde::path(BuildService::getFilePathForModelClassFiles(DocumentationPage::class) . '/test.md'));
touch(Hyde::path(BuildService::getFilePathForModelClassFiles(BladePage::class) . '/test.blade.php'));
touch(Hyde::path(BuildService::getFilePathForModelClassFiles(MarkdownPost::class).'/test.md'));
touch(Hyde::path(BuildService::getFilePathForModelClassFiles(MarkdownPage::class).'/test.md'));
touch(Hyde::path(BuildService::getFilePathForModelClassFiles(DocumentationPage::class).'/test.md'));
touch(Hyde::path(BuildService::getFilePathForModelClassFiles(BladePage::class).'/test.blade.php'));
}

public function deleteContentSourceTestFiles()
{
unlink(Hyde::path(BuildService::getFilePathForModelClassFiles(MarkdownPost::class) . '/test.md'));
unlink(Hyde::path(BuildService::getFilePathForModelClassFiles(MarkdownPage::class) . '/test.md'));
unlink(Hyde::path(BuildService::getFilePathForModelClassFiles(DocumentationPage::class) . '/test.md'));
unlink(Hyde::path(BuildService::getFilePathForModelClassFiles(BladePage::class) . '/test.blade.php'));
unlink(Hyde::path(BuildService::getFilePathForModelClassFiles(MarkdownPost::class).'/test.md'));
unlink(Hyde::path(BuildService::getFilePathForModelClassFiles(MarkdownPage::class).'/test.md'));
unlink(Hyde::path(BuildService::getFilePathForModelClassFiles(DocumentationPage::class).'/test.md'));
unlink(Hyde::path(BuildService::getFilePathForModelClassFiles(BladePage::class).'/test.blade.php'));
}
}
1 change: 0 additions & 1 deletion tests/Unit/HydeUriPathHelperTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


use Hyde\Framework\Hyde;
use Tests\TestCase;

Expand Down