From c3b222847c596706082a59387045357e2981fd68 Mon Sep 17 00:00:00 2001 From: Maks3w Date: Thu, 30 Apr 2015 15:55:16 +0200 Subject: [PATCH 1/4] phpunit.xml is expected to be in component root --- assets/root-files/gitignore | 2 ++ assets/test-files/gitignore | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/root-files/gitignore b/assets/root-files/gitignore index 90bc698..3475a99 100644 --- a/assets/root-files/gitignore +++ b/assets/root-files/gitignore @@ -8,3 +8,5 @@ build/ nbproject tmp/ + +phpunit.xml diff --git a/assets/test-files/gitignore b/assets/test-files/gitignore index 902db60..ba33e47 100644 --- a/assets/test-files/gitignore +++ b/assets/test-files/gitignore @@ -1,2 +1 @@ -phpunit.xml TestConfiguration.php From eab39dcfaa9ab2dd6577658f7fb3d3e7c8197c34 Mon Sep 17 00:00:00 2001 From: Maks3w Date: Thu, 30 Apr 2015 15:56:00 +0200 Subject: [PATCH 2/4] Use a single .gitignore for component --- assets/root-files/gitignore | 1 + assets/test-files/gitignore | 1 - bin/tree-filter.php | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 assets/test-files/gitignore diff --git a/assets/root-files/gitignore b/assets/root-files/gitignore index 3475a99..fcac1e9 100644 --- a/assets/root-files/gitignore +++ b/assets/root-files/gitignore @@ -10,3 +10,4 @@ nbproject tmp/ phpunit.xml +test/TestConfiguration.php diff --git a/assets/test-files/gitignore b/assets/test-files/gitignore deleted file mode 100644 index ba33e47..0000000 --- a/assets/test-files/gitignore +++ /dev/null @@ -1 +0,0 @@ -TestConfiguration.php diff --git a/bin/tree-filter.php b/bin/tree-filter.php index 37c7556..101e5a0 100644 --- a/bin/tree-filter.php +++ b/bin/tree-filter.php @@ -115,7 +115,6 @@ } // Test directory files -copy($assetDir . '/test-files/gitignore', 'test/.gitignore'); file_put_contents( 'test/Bootstrap.php', str_replace('{COMPONENT}', $normalized, file_get_contents($assetDir . '/test-files/Bootstrap.php')) From 67b22de100c69bc82d9c0fd070cf87fd1a1eeaad Mon Sep 17 00:00:00 2001 From: Maks3w Date: Thu, 30 Apr 2015 15:56:59 +0200 Subject: [PATCH 3/4] Exclude vendor in component .gitignore --- assets/root-files/gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/root-files/gitignore b/assets/root-files/gitignore index fcac1e9..316dde6 100644 --- a/assets/root-files/gitignore +++ b/assets/root-files/gitignore @@ -11,3 +11,4 @@ tmp/ phpunit.xml test/TestConfiguration.php +vendor From 1ce1a7afeda4560cada1276e98d3fb54f26a5bec Mon Sep 17 00:00:00 2001 From: Maks3w Date: Thu, 30 Apr 2015 16:33:59 +0200 Subject: [PATCH 4/4] place component tests directly inside of test --- assets/root-files/phpunit.xml.dist | 4 ++-- bin/composer-rewriter.php | 2 +- bin/tree-filter.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/root-files/phpunit.xml.dist b/assets/root-files/phpunit.xml.dist index d60beed..1e17925 100644 --- a/assets/root-files/phpunit.xml.dist +++ b/assets/root-files/phpunit.xml.dist @@ -1,7 +1,7 @@ - + - ./test/{COMPONENT_NAME} + ./test diff --git a/bin/composer-rewriter.php b/bin/composer-rewriter.php index 570d571..c505bc5 100644 --- a/bin/composer-rewriter.php +++ b/bin/composer-rewriter.php @@ -37,7 +37,7 @@ // Setup development autoloading rules $composer['autoload-dev'] = [ 'psr-4' => [ - 'ZendTest\\' . $component . '\\' => 'test/' . $component . '/', + 'ZendTest\\' . $component . '\\' => 'test/', ], ]; diff --git a/bin/tree-filter.php b/bin/tree-filter.php index 101e5a0..76fae20 100644 --- a/bin/tree-filter.php +++ b/bin/tree-filter.php @@ -119,6 +119,6 @@ 'test/Bootstrap.php', str_replace('{COMPONENT}', $normalized, file_get_contents($assetDir . '/test-files/Bootstrap.php')) ); -copy($testConfigDist, 'test/TestConfiguration.php.dist'); -copy($testConfigTravis, 'test/TestConfiguration.php.travis'); +copy($testConfigDist, 'TestConfiguration.php.dist'); +copy($testConfigTravis, 'TestConfiguration.php.travis'); exit(0);