diff --git a/.gitignore b/.gitignore index 9ccde18..7523992 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /.webprj /bin/ /composer.lock +/Configuration/bundles.yml /nbproject /var/ /vendor/ diff --git a/Configuration/bundles.yml b/Configuration/bundles.yml deleted file mode 100644 index 293ed0a..0000000 --- a/Configuration/bundles.yml +++ /dev/null @@ -1,6 +0,0 @@ -# This file will be removed and automatically generated later. -"phplist/phplist4-core": - - "Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle" - - "PhpList\\PhpList4\\ApplicationBundle\\PhpListApplicationBundle" -"phplist/rest-api": - - "PhpList\\RestBundle\\PhpListRestBundle" diff --git a/Tests/Integration/Composer/ScriptsTest.php b/Tests/Integration/Composer/ScriptsTest.php index 01c8349..ef2b32a 100644 --- a/Tests/Integration/Composer/ScriptsTest.php +++ b/Tests/Integration/Composer/ScriptsTest.php @@ -86,4 +86,43 @@ public function binariesExist(string $fileName) { self::assertFileExists($this->getAbsoluteBinariesDirectoryPath() . $fileName); } + + /** + * @return string + */ + private function getBundleConfigurationFilePath(): string + { + return dirname(__DIR__, 3) . '/Configuration/bundles.yml'; + } + + /** + * @test + */ + public function bundleConfigurationFileExists() + { + self::assertFileExists($this->getBundleConfigurationFilePath()); + } + + /** + * @return string[][] + */ + public function bundleClassNameDataProvider(): array + { + return [ + 'framework bundle' => ['Symfony\\\\Bundle\\\\FrameworkBundle\\\\FrameworkBundle'], + 'rest bundle' => ['PhpList\\\\RestBundle\\\\PhpListRestBundle'], + ]; + } + + /** + * @test + * @param string $bundleClassName + * @dataProvider bundleClassNameDataProvider + */ + public function bundleConfigurationFileContainsModuleBundles(string $bundleClassName) + { + $fileContents = file_get_contents($this->getBundleConfigurationFilePath()); + + self::assertContains($bundleClassName, $fileContents); + } } diff --git a/composer.json b/composer.json index 6655248..2380569 100644 --- a/composer.json +++ b/composer.json @@ -58,18 +58,28 @@ "list-modules": [ "PhpList\\PhpList4\\Composer\\ScriptHandler::listModules" ], + "bundle-configuration": [ + "PhpList\\PhpList4\\Composer\\ScriptHandler::createBundleConfiguration" + ], "post-install-cmd": [ "@binaries", - "@document-root" + "@document-root", + "@bundle-configuration" ], "post-update-cmd": [ "@binaries", - "@document-root" + "@document-root", + "@bundle-configuration" ] }, "extra": { "branch-alias": { "dev-master": "4.0.x-dev" + }, + "phplist/phplist4-core": { + "bundles": [ + "PhpList\\RestBundle\\PhpListRestBundle" + ] } } }