-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #466 from hydephp/build-manifest
Update build manifest generation
- Loading branch information
Showing
2 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/framework/tests/Unit/GenerateBuildManifestTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Hyde\Framework\Testing\Unit; | ||
|
||
use Hyde\Framework\Actions\PostBuildTasks\GenerateBuildManifest; | ||
use Hyde\Framework\Hyde; | ||
use Hyde\Testing\TestCase; | ||
|
||
/** | ||
* @covers \Hyde\Framework\Actions\PostBuildTasks\GenerateBuildManifest | ||
*/ | ||
class GenerateBuildManifestTest extends TestCase | ||
{ | ||
public function test_action_generates_build_manifest() | ||
{ | ||
(new GenerateBuildManifest())->run(); | ||
|
||
$this->assertFileExists(Hyde::path('storage/framework/cache/build-manifest.json')); | ||
|
||
$manifest = json_decode(file_get_contents(Hyde::path('storage/framework/cache/build-manifest.json')), true); | ||
|
||
$this->assertIsArray($manifest); | ||
$this->assertCount(2, $manifest); | ||
|
||
$this->assertArrayHasKey('page', $manifest[0]); | ||
$this->assertArrayHasKey('source_hash', $manifest[0]); | ||
$this->assertArrayHasKey('output_hash', $manifest[0]); | ||
|
||
$this->assertStringContainsString('_pages/404.blade.php', $manifest[0]['page']); | ||
$this->assertStringContainsString('_pages/index.blade.php', $manifest[1]['page']); | ||
} | ||
} |