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

Refactor test suite, moving tests into Hyde root and updating some of them #3

Merged
merged 10 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/vendor
/node_modules
/builds
/.run
/.idea
/.vscode
/.vagrant
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
"Hyde\\Testing\\": "tests/"
}
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions packages/framework/src/Concerns/GeneratesPageMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Hyde\Framework\Hyde;
use Hyde\Framework\Models\MarkdownPost;
use Tests\TestCase;

/**
* Generates metadata for page models that have front matter.
Expand All @@ -21,7 +20,7 @@ public function constructMetadata(): void
{
$this->parseFrontMatterMetadata();

if ($this instanceof MarkdownPost || $this instanceof TestCase) {
if ($this instanceof MarkdownPost || isset($this->forceOpenGraph) && $this->forceOpenGraph) {
$this->makeOpenGraphPropertiesForArticle();
}
}
Expand Down
47 changes: 0 additions & 47 deletions packages/framework/tests/Unit/HydePathHelperTest.php

This file was deleted.

9 changes: 6 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
stopOnFailure="false">
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./vendor/hyde/framework/tests/Feature</directory>
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
<testsuite name="Unit">
<directory suffix="Test.php">./vendor/hyde/framework/tests/Unit</directory>
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Validators">
<directory suffix="Test.php">./tests/Validators</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./vendor/hyde/framework/src</directory>
<directory suffix=".php">./packages/framework/src</directory>
</include>
</coverage>
<groups>
Expand All @@ -32,4 +32,7 @@
<php>
<env name="ENV" value="testing"/>
</php>
<listeners>
<listener class="\Hyde\Testing\TestListener" />
</listeners>
</phpunit>
2 changes: 1 addition & 1 deletion tests/CreatesApplication.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Tests;
namespace Hyde\Testing;

use Illuminate\Contracts\Console\Kernel;
use Illuminate\Foundation\Application;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Tests\Feature\Actions;
namespace Hyde\Testing\Feature\Actions;

use Hyde\Framework\Actions\ChecksIfConfigIsUpToDate;
use Tests\TestCase;
use Hyde\Testing\TestCase;

/**
* @covers \Hyde\Framework\Actions\ChecksIfConfigIsUpToDate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace Tests\Feature\Actions;
namespace Hyde\Testing\Feature\Actions;

use Hyde\Framework\Actions\CreatesNewPageSourceFile;
use Hyde\Framework\Exceptions\FileConflictException;
use Hyde\Framework\Exceptions\UnsupportedPageTypeException;
use Hyde\Framework\Hyde;
use Hyde\Framework\Models\BladePage;
use Hyde\Framework\Models\DocumentationPage;
use Tests\TestCase;
use Hyde\Testing\TestCase;

/**
* @covers \Hyde\Framework\Actions\CreatesNewPageSourceFile
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Tests\Feature\Actions;
namespace Hyde\Testing\Feature\Actions;

use Hyde\Framework\Actions\GeneratesDocumentationSearchIndexFile as Action;
use Hyde\Framework\Hyde;
use Tests\TestCase;
use Hyde\Testing\TestCase;

/**
* @covers \Hyde\Framework\Actions\GeneratesDocumentationSearchIndexFile
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Tests\Feature\Actions;
namespace Hyde\Testing\Feature\Actions;

use Hyde\Framework\Actions\GeneratesTableOfContents;
use Tests\TestCase;
use Hyde\Testing\TestCase;

/**
* @covers \Hyde\Framework\Actions\GeneratesTableOfContents
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Tests\Feature\Actions;
namespace Hyde\Testing\Feature\Actions;

use Hyde\Framework\Actions\PublishesHomepageView;
use Hyde\Framework\Contracts\ActionContract;
use Hyde\Framework\Hyde;
use Tests\TestCase;
use Hyde\Testing\TestCase;

/**
* @covers \Hyde\Framework\Actions\PublishesHomepageView
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Tests\Feature\Actions;
namespace Hyde\Testing\Feature\Actions;

use Hyde\Framework\Actions\PublishesHydeViews;
use Hyde\Framework\Hyde;
use Tests\TestCase;
use Hyde\Testing\TestCase;

/**
* @covers \Hyde\Framework\Actions\PublishesHydeViews
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Tests\Feature;
namespace Hyde\Testing\Feature;

use Hyde\Framework\Services\AssetService;
use Tests\TestCase;
use Hyde\Testing\TestCase;

/**
* @covers \Hyde\Framework\Services\AssetService
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Tests\Feature;
namespace Hyde\Testing\Feature;

use Hyde\Framework\Helpers\Author as AuthorHelper;
use Hyde\Framework\Models\Author as AuthorModel;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Config;
use Tests\TestCase;
use Hyde\Testing\TestCase;

/**
* Class AuthorHelperTest.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Tests\Feature;
namespace Hyde\Testing\Feature;

use Hyde\Framework\Actions\CreatesNewMarkdownPostFile;
use Hyde\Framework\Helpers\Author;
use Hyde\Framework\Hyde;
use Illuminate\Support\Facades\Config;
use Tests\TestCase;
use Hyde\Testing\TestCase;

/**
* Test that the Author feature works in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Tests\Feature;
namespace Hyde\Testing\Feature;

use Hyde\Framework\Hyde;
use Hyde\Framework\Services\RebuildService;
use Hyde\Framework\StaticPageBuilder;
use Illuminate\Support\Facades\File;
use Tests\TestCase;
use Hyde\Testing\TestCase;

/**
* Class BuildOutputDirectoryCanBeChangedTest.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Tests\Feature;
namespace Hyde\Testing\Feature;

use Hyde\Framework\Services\Markdown\Shortcodes\AbstractColoredBlockquote;
use Tests\TestCase;
use Hyde\Testing\TestCase;

/**
* Class ColoredBlockquoteShortcodesTest.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Tests\Feature\Commands;
namespace Hyde\Testing\Feature\Commands;

use Hyde\Framework\Actions\CreatesDefaultDirectories;
use Hyde\Framework\Hyde;
use Tests\TestCase;
use Hyde\Testing\TestCase;

/**
* @covers \Hyde\Framework\Commands\HydeBuildStaticSiteCommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Tests\Feature\Commands;
namespace Hyde\Testing\Feature\Commands;

use Tests\TestCase;
use Hyde\Testing\TestCase;

class DebugCommandTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Tests\Feature\Commands;
namespace Hyde\Testing\Feature\Commands;

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

/**
* @covers \Hyde\Framework\Commands\HydeBuildRssFeedCommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Tests\Feature\Commands;
namespace Hyde\Testing\Feature\Commands;

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

/**
* @covers \Hyde\Framework\Commands\HydeBuildSearchCommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Tests\Feature\Commands;
namespace Hyde\Testing\Feature\Commands;

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

/**
* @covers \Hyde\Framework\Commands\HydeBuildSitemapCommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Tests\Feature\Commands;
namespace Hyde\Testing\Feature\Commands;

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

/**
* @covers \Hyde\Framework\Commands\HydeInstallCommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Tests\Feature\Commands;
namespace Hyde\Testing\Feature\Commands;

use Exception;
use Hyde\Framework\Exceptions\FileConflictException;
use Hyde\Framework\Hyde;
use Tests\TestCase;
use Hyde\Testing\TestCase;

/**
* @covers \Hyde\Framework\Commands\HydeMakePageCommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Tests\Feature\Commands;
namespace Hyde\Testing\Feature\Commands;

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

/**
* @covers \Hyde\Framework\Commands\HydePublishHomepageCommand
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Tests\Feature\Commands;
namespace Hyde\Testing\Feature\Commands;

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

/**
* @covers \Hyde\Framework\Commands\HydePublishViewsCommand
Expand Down
Loading