1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Hyde\Testing; |
6
|
|
|
|
7
|
|
|
use Hyde\Hyde; |
8
|
|
|
|
9
|
|
|
class DefaultContentTest extends UnitTestCase |
|
|
|
|
10
|
|
|
{ |
11
|
|
|
public static function setUpBeforeClass(): void |
12
|
|
|
{ |
13
|
|
|
self::needsKernel(); |
14
|
|
|
} |
15
|
|
|
|
16
|
|
|
public function testDefaultPagesArePresent() |
17
|
|
|
{ |
18
|
|
|
$this->assertFileExists(Hyde::path('_pages/index.blade.php')); |
|
|
|
|
19
|
|
|
$this->assertFileExists(Hyde::path('_pages/404.blade.php')); |
20
|
|
|
|
21
|
|
|
$this->assertStringContainsString( |
22
|
|
|
'<title>Welcome to HydePHP!</title>', |
23
|
|
|
file_get_contents(Hyde::path('_pages/index.blade.php')) |
24
|
|
|
); |
25
|
|
|
|
26
|
|
|
$this->assertStringContainsString( |
27
|
|
|
'<title>404 - Page not found</title>', |
28
|
|
|
file_get_contents(Hyde::path('_pages/404.blade.php')) |
29
|
|
|
); |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
public function testDefaultCompiledStylesheetIsPresent() |
33
|
|
|
{ |
34
|
|
|
$this->assertFileExists(Hyde::path('_media/app.css')); |
35
|
|
|
|
36
|
|
|
$this->assertStringContainsString( |
37
|
|
|
'https://tailwindcss.com', |
38
|
|
|
file_get_contents(Hyde::path('_media/app.css')) |
39
|
|
|
); |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
public function testLaravelMixResourcesArePresent() |
43
|
|
|
{ |
44
|
|
|
$this->assertFileExists(Hyde::path('resources/assets/app.css')); |
45
|
|
|
$this->assertFileExists(Hyde::path('resources/assets/app.js')); |
46
|
|
|
|
47
|
|
|
$this->assertFileContainsString('@tailwind base;', Hyde::path('resources/assets/app.css')); |
48
|
|
|
$this->assertFileContainsString('@tailwind components;', Hyde::path('resources/assets/app.css')); |
49
|
|
|
$this->assertFileContainsString('@tailwind utilities;', Hyde::path('resources/assets/app.css')); |
50
|
|
|
|
51
|
|
|
$this->assertFileContainsString('This is the main JavaScript', Hyde::path('resources/assets/app.js')); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
protected function assertFileContainsString(string $string, string $file) |
55
|
|
|
{ |
56
|
|
|
$this->assertStringContainsString($string, file_get_contents($file)); |
57
|
|
|
} |
58
|
|
|
} |
59
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths