Skip to content

Commit 39afc63

Browse files
committed
Add empty PhpExtensionsQuestionTest.php
1 parent 6dc0c6d commit 39afc63

File tree

5 files changed

+47
-8
lines changed

5 files changed

+47
-8
lines changed

phpunit.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
<directory suffix=".php">src</directory>
1717
</include>
1818

19+
<exclude>
20+
<file>src/helpers.php</file>
21+
</exclude>
22+
1923
<report>
2024
<html outputDirectory=".coverage"/>
2125
<text outputFile="php://stdout"/>

tests/Feature/Commands/DockerGenerateCommandTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use BlameButton\LaravelDockerBuilder\Integrations\SupportedPhpExtensions;
66
use BlameButton\LaravelDockerBuilder\Tests\TestCase;
7-
use Illuminate\Contracts\Console\Kernel;
87
use Mockery\MockInterface;
98

109
/**
@@ -118,19 +117,19 @@ public function provideInvalidOptions(): array
118117
{
119118
return [
120119
'php version' => [
121-
"Invalid value [unsupported] for option [php-version]",
120+
'Invalid value [unsupported] for option [php-version]',
122121
'docker:generate -n -p unsupported -e bcmath -o -a -m npm -b vite',
123122
],
124123
'php extensions' => [
125-
"Extension [unsupported] is not supported.",
124+
'Extension [unsupported] is not supported.',
126125
'docker:generate -n -p 8.2 -e bcmath,unsupported -o -a -m npm -b vite',
127126
],
128127
'node package manager' => [
129-
"Invalid value [unsupported] for option [node-package-manager]",
128+
'Invalid value [unsupported] for option [node-package-manager]',
130129
'docker:generate -n -p 8.2 -e bcmath -o -a -m unsupported -b vite',
131130
],
132131
'node build tool' => [
133-
"Invalid value [unsupported] for option [node-build-tool]",
132+
'Invalid value [unsupported] for option [node-build-tool]',
134133
'docker:generate -n -p 8.2 -e bcmath -o -a -m npm -b unsupported',
135134
],
136135
];
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace BlameButton\LaravelDockerBuilder\Tests\Unit\Commands\GenerateQuestions;
4+
5+
class PhpExtensionsQuestionTest
6+
{
7+
8+
}

tests/Unit/DockerServiceProviderTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace BlameButton\LaravelDockerBuilder\Tests\Unit;
44

5-
use BlameButton\LaravelDockerBuilder\Commands\DockerGenerateCommand;
6-
use BlameButton\LaravelDockerBuilder\Commands\GenerateQuestions\Choices\PhpVersion;
75
use BlameButton\LaravelDockerBuilder\DockerServiceProvider;
86
use BlameButton\LaravelDockerBuilder\Integrations\SupportedPhpExtensions;
97
use BlameButton\LaravelDockerBuilder\Tests\TestCase;
@@ -44,4 +42,4 @@ public function testItPublishesConfig(): void
4442
package_path('config/docker-builder.php') => base_path('config/docker-builder.php'),
4543
], ServiceProvider::$publishes[DockerServiceProvider::class]);
4644
}
47-
}
45+
}

tests/Unit/HelpersTest.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace BlameButton\LaravelDockerBuilder\Tests\Unit;
4+
5+
use PHPUnit\Framework\TestCase;
6+
7+
/**
8+
* @covers package_path()
9+
*/
10+
class HelpersTest extends TestCase
11+
{
12+
public function testItRegistersFunction(): void
13+
{
14+
self::assertTrue(function_exists('package_path'));
15+
}
16+
17+
public function testItReturnsPackagePath(): void
18+
{
19+
$path = package_path();
20+
21+
self::assertEquals(dirname(__FILE__, 3), $path);
22+
}
23+
24+
public function testItReturnsPackagePathSubPath(): void
25+
{
26+
$path = package_path('composer.json');
27+
28+
self::assertEquals(dirname(__FILE__, 3).'/composer.json', $path);
29+
}
30+
}

0 commit comments

Comments
 (0)