-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Add the Symfony console and the public web/ directory (#28)
Note: The console and the web directory will only be added if this project is the project root (i.e., usually when developing the package), not if is a requirement of the base-distribution package (or any other package).
- Loading branch information
1 parent
578d1f6
commit 4a69bcd
Showing
3 changed files
with
107 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
/.idea/ | ||
/.project | ||
/.webprj | ||
/bin/ | ||
/composer.lock | ||
/nbproject | ||
/vendor/ | ||
/web/ |
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,89 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace PhpList\RestBundle\Tests\Integration\Composer; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* Testcase. | ||
* | ||
* @author Oliver Klee <[email protected]> | ||
*/ | ||
class ScriptsTest extends TestCase | ||
{ | ||
/** | ||
* @test | ||
*/ | ||
public function webDirectoryHasBeenCreated() | ||
{ | ||
self::assertDirectoryExists($this->getAbsoluteWebDirectoryPath()); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
private function getAbsoluteWebDirectoryPath(): string | ||
{ | ||
return dirname(__DIR__, 3) . '/web/'; | ||
} | ||
|
||
/** | ||
* @return string[][] | ||
*/ | ||
public function webDirectoryFilesDataProvider(): array | ||
{ | ||
return [ | ||
'production entry point' => ['app.php'], | ||
'development entry point' => ['app_dev.php'], | ||
'testing entry point' => ['app_test.php'], | ||
'.htaccess' => ['.htaccess'], | ||
]; | ||
} | ||
|
||
/** | ||
* @test | ||
* @param string $fileName | ||
* @dataProvider webDirectoryFilesDataProvider | ||
*/ | ||
public function webDirectoryFilesExist(string $fileName) | ||
{ | ||
self::assertFileExists($this->getAbsoluteWebDirectoryPath() . $fileName); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function binariesDirectoryHasBeenCreated() | ||
{ | ||
self::assertDirectoryExists($this->getAbsoluteBinariesDirectoryPath()); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
private function getAbsoluteBinariesDirectoryPath(): string | ||
{ | ||
return dirname(__DIR__, 3) . '/bin/'; | ||
} | ||
|
||
/** | ||
* @return string[][] | ||
*/ | ||
public function binariesDataProvider(): array | ||
{ | ||
return [ | ||
'Symfony console' => ['console'], | ||
]; | ||
} | ||
|
||
/** | ||
* @test | ||
* @param string $fileName | ||
* @dataProvider binariesDataProvider | ||
*/ | ||
public function binariesExist(string $fileName) | ||
{ | ||
self::assertFileExists($this->getAbsoluteBinariesDirectoryPath() . $fileName); | ||
} | ||
} |
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